My PHP Reference

Index -|- Personal Samples -|- Home


PHP is a POWERFUL (scripting) language, that is now available for use on most server space ... the web file extension will be .php, and this will be passed through the server php runtime, before being passed back to the browser as HTML ... This is my own personal php reference page. It makes no attempt to be all inclusive.

code blocks, __FILE__, getcwd, help


Code Blocks

In files with the .php extension, within the HTML, PHP code blocks can be encased as follows :-

echo "Hello World";


getcwd - Show current work directory

Built in function that shows the current work directory :-

<title>show current work directory</title>
<h1 align="center">show current work directory</h1>
echo "<p>root=<b>".getcwd()."/.</b></p>\n";
echo "<p>file=<b>".__FILE__."</b></p>\n";

Link to dir01.php ...


PHP Help

I find the online PHP HELP is fantastic ;=)) Like placing [ php opendir ] into a Yahoo! search, gives you many links, like - - which puts you in the PHP Manual, and there are ALWAYS examples, ready to cut, paste and try for your self ...

I use some great PHP scripts to massage JPG image - try a Yahoo! search [php exif_thumbnail], and [php imagecreatefromjpeg] - extracting any EXIF information, writing a 'thumb', writing a normal image, and finally an image without the EXIF ... this is using it in a local WIN32 runtime environment, as mini-applications ...

To learn more exactly HOW the PHP has been configured on your server, you can use the phpinfo() function. Create a file, called say phpinfo.php, and add the single line -

<?php phpinfo(); ?>

Unload this to your site, and point your browser at it. You should be rewarded with a BIG list of parameters, showing what is enabled, and disabled in your particular server. You can compare it to what is enabled in my GoDaddy server spaces through this URI ...


checked by tidy  Valid HTML 4.01 Transitional