Something for your empty home

Here are few lines of code that I have repeatedly found useful, especially when moving home between different web hosts.

Print the complete address of the page from where it is hosted:

$pageURL = $_SERVER[‘HTTPS’] == ‘on’ ? ‘https://’ : ‘http://’;
echo $pageURL;

Everyone knows about phpInfo – a dump of all the PHP settings:

<?php phpinfo(); ?>

When using a shared host that allows overriding your PHP ini file, it is worth while knowing the path from where the file is loaded:

<?php var_dump( get_cfg_var(‘cfg_file_path’) ); ?>