2108 solutions found
Page 19 of 106votes
I am struggling to run a single test method named `testSaveAndDrop` in the file `escalation/EscalationGroupTest.php` with `phpunit`. I tried the following combi...
votes
with a new array I do this: $aVal = array(); $aVal[key1][var1] = "something"; $aVal[key1][var2] = "something else";...
votes
Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could forc...
votes
How can I get the last day of the month in PHP? Given: $a_date = "2009-11-23" I want 2009-11-30; and given $a_date = "2009-12...
votes
In PHP I am trying to create a newline character: echo $clientid; echo ' '; echo $lastname; echo ' '; echo '\r\n&...
votes
When debugging in PHP, I frequently find it useful to simply stick a [var_dump()][1] in my code to show me what a variable is, what its value is, and the same f...
votes
How would it be possible to generate a random, unique string using numbers and letters for use in a verify link? Like when you create an account on a website, a...
votes
I need to enable *pdo_mysql* in my [EasyPHP][1] environment, so I went to the *php.ini* file and uncommented the following line: extension=php_pdo_mysql....
votes
I am trying to decode a JSON string into an array but i get the following error. > Fatal error: Cannot use object of type stdClass as array Here is the...
votes
I'm checking out some `PHP 5.3.0` features and ran across some code on the site that looks quite funny: public function getTotal($tax) {...
votes
I tried to parse a JSON file using PHP. But I am stuck now. This is the content of my JSON file: ```json { "John": { "status":&q...
votes
I am on shared hosting and have [cPanel][1], Apache, and PHP is run by [FastCGI][2]. Where does PHP store the error log? Is there another way I can find the...
votes
Is there a static analysis tool for PHP source files? The binary itself can check for syntax errors, but I'm looking for something that does more, like:...
votes
Scenario: trait A { function calc($v) { return $v+1; } } class MyClass { use A;...
votes
I'm wondering if/how you can add custom headers to a cURL HTTP request in PHP. I'm trying to emulate how iTunes grabs artwork and it uses these non-stan...
votes
Does anyone know whether there is an `assert` or something like that which can test whether an exception was thrown in the code being tested?
votes
I am downloading a JSON file from an online source and and when it runs through the loop I am getting this error: > Fatal error: Maximum execution time of...
votes
How can I convert string to `boolean`? $string = 'false'; $test_mode_mail = settype($string, 'boolean'); var_dump($...
votes
I have an array where I want to search the `uid` and get the key of the array. ## Examples Assume we have the following 2-dimensional array: $userdb...
votes
**UPDATE 2:** I have now removed the following from the .php file: <?php error_reporting( E_ALL ); ?> I have set display_erros in php.ini as...