366 solutions found in php-dev
Page 1 of 19votes
What is the meaning of `{ }` (curly braces) in string literals in PHP?
votes
It seems pretty simple but I can't find a good way to do it. Say in the first page I create a variable $myVariable = "Some text"; And...
votes
I have a question regarding `NULL` in PHP: $a = ''; if($a == NULL) { echo 'is null'; } Why do I see **is nu...
votes
When running a PHPUnit test, I would like to be able to dump output so I can debug one or two things. I have tried the following (similar to the [PHPUnit Man...
votes
Coming from C++ background ;) How can I overload PHP functions? One function definition if there are any arguments, and another if there are no argument...
votes
How to call a JavaScript function from PHP? <?php jsfunction(); // or echo(jsfunction()); // or // Anything e...
votes
I would like to test my application on PHP 5.3 up to PHP 8.2. Where and how can I install the versions and how can I switch them by running a small script?...
votes
I'm not a PHP developer, so I'm wondering what the advantages and disadvantages are in PHP to using explicit getter/setters, in a pure OOP style, with p...
votes
I'm trying to replace multiple spaces with a single space. When I use `ereg_replace`, I get an error about it being deprecated. ereg_replace("[...
votes
For example, I would like to create an array from the elements in this string: $str = 'red, green, blue ,orange'; I know you can e...
votes
I've written a little function to establish the current site url protocol but I don't have SSL and don't know how to test if it works under https. *...
votes
There are two distinct ways to access methods in PHP, but what's the difference? $response->setParameter('foo', 'bar'); and...
votes
Given an associative array: array("key1" => "value1", "key2" => "value2", ...) How would I go about remo...
votes
How do I check if a URL exists (not 404) in PHP?
votes
I have some code that appears to merge the data from two arrays using `+=`, but it doesn't include all of the elements in the element. How does it work?...
votes
When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php) and I run `./configu...
votes
I'm trying to use dynamic variable names. So inside this loop I want to create `$file0`, `$file1`, and `$file2`: for($i=0; $i<=2; $i++) {...
votes
I've got this very simple thing that just outputs some stuff in CSV format, but it's got to be UTF-8. I open this file in TextEdit or TextMate or Dreamw...
votes
I am writing a SQL query creator using some parameters. In Java, it's very easy to detect the last element of an array from inside the for loop by just chec...
votes
I want to increase *maximum execution time* in php , not by changing `php.ini` file. I want to Increase it from my php file. Is this possible?