378 solutions found in general-dev
Page 5 of 19votes
I need to remove all characters from a string which aren't in `a-z A-Z 0-9` set or are not spaces. Does anyone have a function to do this?
votes
I keep reading it is poor practice to use the PHP close tag `?>` at the end of the file. The header problem seems irrelevant in the following context (and th...
votes
I want to create a directory if it does not exist already. Is using the `is_dir` function enough for that purpose? if ( !is_dir( $dir ) ) { m...
votes
How do I set a default value in Doctrine 2?
votes
It often happens to me to handle data that can be either an array or a null variable and to feed some `foreach` with these data. $values = get_values();...
votes
I've been trying to study up on PHP lately, and I find myself getting hung up on traits. I understand the concept of horizontal code reuse and not wanting t...
votes
I need to convert seconds to "Hour:Minute:Second". For example: "685" converted to "00:11:25" How can I achieve this?
votes
I've had a look over [here][1] but didn't find any details on the best file permissions. I also took a look at some of WordPress's form's quest...
votes
When trying to create a new laravel project, The following error appears on the CLI: > Could not open input file: artisan > > Script php artisan clea...
votes
> **Possible Duplicate:** > [PHP detecting request type (GET, POST, PUT or DELETE)](https://stackoverflow.com/questions/359047/php-detecting-request-typ...
votes
I see there are [a few][1]. Which ones are maintained and easy to use? What are their pros and cons? [1]: http://codeigniter.com/wiki/Category:Libraries...
votes
I got this error when I requested to update the [PHP][1] version from 5.2.17 to PHP 5.3.21 on the server. <div style="border:1px solid #990000;paddi...
votes
How to find number of days between two dates using PHP?
votes
What's the correct way to round a PHP string to two decimal places? $number = "520"; // It's a string from a database $formatted...
votes
I've run into a few cases with WordPress installs with [Bluehost][1] where I've encountered errors with my WordPress theme because the uploads folder `w...
votes
I want to read a file line by line, but without completely loading it in memory. My file is too large to open in memory, and if try to do so I always get out...
votes
What are the differences between `htmlspecialchars()` and `htmlentities()`. When should I use one or the other?
votes
I have a website hosted on a PC I have no access to. I have an upload form allowing people to upload mp3 files up to 30MB big. My server side script is done in...
votes
I am converting a PHP 5.3 library to work on PHP 5.2. The main thing standing in my way is the use of late static binding like `return new static($options);` ,...
votes
I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big datab...