Get the included files with PHP

PHP’s get_included_files() function returns an array containing a list of included files by your script, including the script itself. This post looks at the filenames returned in the array and corrects a couple of errors in the PHP documentation.

Categories PHP

Using filters with the Google Analytics API and PHP

The Google Analytics API allows filtering to be done on the result data before it is fetched so you could, for example, only get data for visitors from the United States. This post shows how to format the filters field in PHP and also how to use my Google Analytics API PHP Class with filters.

Categories PHP

Set PHP configuration options in an Apache virtualhost

I’ve previously looked at how to set PHP configuration options in an Apache .htaccess file which allows you to change PHP_INI_PERDIR or PHP_INI_ALL settings but notPHP_INI_SYSTEM. All three of these settings types can be modified in an Apache virtualhost’s settings.

Categories PHP

Rounding numbers with PHP

I have previously looked at rounding numbers with MySQL and Javascript and in this post look at rounding numbers with PHP using the round() ceil() floor() number_format() and s/printf() functions.

Categories PHP