PHP list of php.ini directives

PHP allows you to set a variety of configuration settings in either the web server’s configuration (e.g. Apache’s httpd.conf or .htaccess) and using the ini_set function. The PHP manual contains a complete list of php.ini directives and this short post is simply my place of bookmarking the list, as I often need to refer to …

Read more

Categories PHP

Using + to merge arrays with PHP

I’ve been working at a new job and the interesting thing when working with other people’s code is you often learn a heap of stuff you didn’t already know. A couple of weeks ago I came across a way to merge arrays in PHP with the + operator, instead of using the array functions (e.g. array_merge) so share this here.

Categories PHP

Get the Feedburner original link with PHP

Many websites use Feedburner to serve their RSS feed. The link from the Feedburner feed to the article is a Feedburner URL which then redirects to the original URL. The original URL is still contained in the XML for the feed in the element named <feedburner:origLink> and this can be parsed out using PHP’s SimpleXML library, but it’s not quite as simple as referring to ->feeburner:origLink because this will not work.

Categories PHP

Get all variables assigned to Smarty – Part 1

I’ve been working with the PHP templating engine Smarty at a new job and needed to be able to dump a list of variables that had been assigned to Smarty for debugging purposes. This quick post shows how to dump the variables in your PHP code.

Categories PHP

Extract domain, path etc from a full url with PHP

PHP’s parse_url function makes it easy to extract the domain, path and other useful bits of information from a full URL. This can be useful for a variety of purposes, such as when spidering content from a website and needing to extract particular pieces of information from the links in the page.

Categories PHP