366 solutions found in php-dev
Page 5 of 19votes
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 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 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 have two classes, `class ClassOne { }` and `class ClassTwo {}`. I am getting a string which can be either `"One"` or `"Two"`. Instead o...
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...
votes
We are running XAMPP with PHP 7.0 because our new products requires PHP 7. But there are old projects which use functions like `mysql_connect`, etc. Those ar...
votes
What is the simplest way of doing two way encryption in common PHP installs? I need to be able to encrypt data with a string key, and use the same key to dec...
votes
For example, how do I get `Output.map` **from** `F:\Program Files\SSH Communications Security\SSH Secure Shell\Output.map` with PHP?
votes
Is there a way in JavaScript to compare values from one array and see if it is in another array? Similar to PHP's [`in_array`](http://www.php.net/in_arr...
votes
I see these in PHP all the time, but I don't have a clue as to what they actually mean. What does `->` do and what does `=>` do? And I'm not ta...
votes
I have a problem to convert an object stdClass to array. I have tried in this way: return (array) $booking; or return (array) json_decode($b...
votes
Is it possible? function test() { echo "function name is test"; }