Change PHP Session Time
The default time for a PHP session is 1440 seconds (24 minutes). After that, the session data is eligible for garbage collection and the user may need …
Read Article →61 articles about php development, tools, and best practices
The default time for a PHP session is 1440 seconds (24 minutes). After that, the session data is eligible for garbage collection and the user may need …
Read Article →Sometimes you need to know the full filesystem path of your PHP script — for example, when building file paths for includes or writing to a log file. …
Read Article →This script works in all browsers, including Internet Explorer! 🙂
Sometimes you need to force the browser to download a file instead of displaying it …
Read Article →I often have to show a shortened version of a news item and then a link to show the entire news article or whatever.
Here’s a way to get that …
Read Article →Need to read a file line by line in PHP? The file() function is the quickest way to do it. It reads the entire file into an array where each element …
Ever find yourself typing the headers into the php mail() function over and over again?
Try using a standard function and calling it when you need to …
Read Article →Today I tried to save arabic text inside a javascript file and on saving encountered a dialog box asking me to first convert the document to UTF8.
Why …
Read Article →Create a file called .htaccess in the root of your public_html/htdocs of your domain.
This is useful when you want to handle error pages gracefully …
Read Article →When PHP encounters a class that hasn’t been defined yet, you can use __autoload to automatically add them instead of including masses of …
Read Article →If you ever find yourself needing to do some ajax and in turn sending strings of characters via javascript then you should really try …
Read Article →You can use ucwords() to uppercase the first character of each word in a string. This is handy for formatting names, titles, or any user input that …
If you’re coming from PHP and miss having print_r for dumping objects and arrays while debugging, ActionScript 3 doesn’t have a built-in …
What the hey? What does this mean?
You may one day end up seeing the following error message produced by PHP and wonder to yourself:
PHP Parse error: …
Read Article →