366 solutions found in php-dev
Page 8 of 19votes
If I have a PHP string in the format of `mm-dd-YYYY` (for example, 10-16-2003), how do I properly convert that to a `Date` and then a `DateTime` in the format o...
votes
How can I get the last key of an array?
votes
How can I remove duplicate values from a multi-dimensional array in PHP? Example array: Array ( [0] => Array ( [0] => abc...
votes
I wrote a PHP code like this $site="http://www.google.com"; $content = file_get_content($site); echo $content; But when I remove &...
votes
For example I had a folder called `Temp' and I wanted to delete or flush all files from this folder using PHP. Could I do this?
votes
How should I read any header in PHP? For example the custom header: `X-Requested-With`.
votes
I have a web application on a Linux server which starts with `<?` I needed to copy this application to a windows environment and everything is working fin...
votes
$string = " put returns between paragraphs for linebreak add 2 spaces at end "; Want to remove all new lines from st...
votes
What would be the best way to list all the files in one directory with PHP? Is there a $_SERVER function to do this? I would like to list all the files in the u...
votes
It seems that PHP's `===` operator is case sensitive. So is there a reason to use `strcmp()`? Is it safe to do something like the following? if ($...
votes
I am using Laravel with Redis .When I am trying to access a key by get method then get following error "WRONGTYPE Operation against a key holding the wrong...
votes
Having a look on the PHP documentation, the following two methods of the `DateTime` object would both seem to solve my problem: - <a href="http://au....
votes
This error message is being presented, any suggestions? > Allowed memory size of 33554432 bytes exhausted (tried to allocate > 43148176 bytes) in php
votes
I found the discussion on [Do you test private method][1] informative. I have decided, that in some classes, I want to have protected methods, but test them....
votes
I need to be able to call a function, but the function name is stored in a variable, is this possible? e.g: ```php function foo () { //code here }...
votes
I need to split my string input into an array at the commas. Is there a way to explode a comma-separated string into a flat, indexed array? Input:...
votes
I'm pretty new at laravel, in fact and I'm trying to create my very first project. for some reason I keep getting this error (I haven't even started...
votes
I have several [PHP][1] pages echoing out various things into [HTML][2] pages with the following code. <meta http-equiv="Content-type" conte...
votes
When I want to remove a Cookie I try unset($_COOKIE['hello']); I see in my cookie browser from firefox that the cookie still exists. How can I...
votes
I'm reading the Laravel Blade [documentation][1] and I can't figure out how to assign variables inside a template for use later. I can't do `{{ $old...