2108 solutions found
Page 10 of 106votes
I know how to insert it to the end by: $arr[] = $item; But how to insert it to the beginning?
votes
I'm in the process of converting one of our web applications from CodeIgniter to Laravel. However at this moment we don't want to add the `updated_at` /...
votes
**Expected Input:** getDatesFromRange( '2010-10-01', '2010-10-05' ); **Expected Output:** Array( '2010-10-01', '201...
votes
If I have an `stdObject` say, `$a`. Sure there's no problem to assign a new property, `$a`, $a->new_property = $xyz; But then I want to remo...
votes
I have already researched a lot of site on how can I convert PHP DateTime object to String. I always see "String to DateTime" and not "DateTime...
votes
I'm wondering what's the best, the cleanest and the most simply way to work with many-to-many relations in Doctrine2. Let's assume that we'v...
votes
I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of ti...
votes
I use `in_array()` to check whether a value exists in an array like below, $a = array("Mac", "NT", "Irix", "Linux"...
votes
I have a string with new line characters. I want to convert that string into an array, and for every new line, jump one index place in the array. If the stri...
votes
I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface. How does one...
votes
I'm trying to install Facebook PHP SDK with Composer. This is what I get $ composer install Loading composer repositories with package informati...
votes
I did some research on this topic, and there are some experts who have said that it is not [possible](https://stackoverflow.com/questions/3045097/php-redirect-a...
votes
PHP 7 introduced the Spaceship (<=>) operator. What is it and how does it work?
votes
I am trying to send mail from localhost. but i am unable to send the mail from localhost so can anybody tell me that how to reconfigure my xampp to send mail...
votes
I have a date returned as part of a MySQL query in the form `2010-09-17`. I would like to set the variables $Date2 to $Date5 as follows: `$Date2 = $Date +...
votes
I am trying to convert a timestamp of the format `2009-09-12 20:57:19` and turn it into something like `3 minutes ago` with PHP. I found a useful script to d...
votes
I am facing an issue with URLs, I want to be able to convert titles that could contain anything and have them stripped of all special characters so they only ha...
votes
I have two classes, `class ClassOne { }` and `class ClassTwo {}`. I am getting a string which can be either `"One"` or `"Two"`. Instead o...
votes
I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the use...
votes
I'd like to be able to add a custom attribute/property to an Laravel/Eloquent model when it is loaded. For instance, at the moment, in my controller I ha...