This post has some example PHP code which can be used to work out which error_reporting levels are reported and which are not from an integer value.PHP code Either use the $error = error_reporting() … [Read more...] about Work out PHP’s error reporting from an integer value
Information and howto articles for PHP
PHP is a powerful open source server-sided scripting language that can be used on a wide variety of operating systems and webservers, including Apache on UNIX and IIS on Windows.
PHP contains numerous extensions which enable you to dynamically create images and flash files, parse xml, connect to remote servers using pop, imap, ftp, http and raw sockets, natively access many database servers including PostgreSql, MySQL and Microsoft SQL Server, compress and decompress files, lookup domain names and and much more.
PHP has an excellent manual and online documentation which covers every function for every extension available.
PHP's fputcsv function is very useful for creating CSV files, but by default will write out to a file. There are a couple of tricks to be able to keep it all in memory or instead write the CSV data … [Read more...] about Use PHP’s fputcsv without writing to a file
If you are attempting to get files with a .html extension parsed as PHP with Nginx + php-fpm, you might get an "access denied" error in your browser, and the error message "Access to the script '...' … [Read more...] about Fix “access denied” error when parsing HTML as PHP with Nginx
PHP's PDO has a nifty way of fetching database records into an object, but there's a slight gotcha when also using a constructor which initializes the class properties.tl;dr Data is populated before … [Read more...] about A gotcha with PHP’s PDO::FETCH_CLASS
If you've got a filename that you need to remove the extension from with PHP, there are a number of ways to do it. Here's three ways, with some benchmarking.Using pathinfo The pathinfo() function … [Read more...] about Remove extension from a filename with PHP
A few days ago, I posted how to temporarily change the auto increment increment in MySQL. This post has an extension class to PHP's PDO to get the current auto increment value, change it to a new … [Read more...] about PHP PDO class to set the MySQL auto_increment_increment