admin

Author


Closing PHP Tag Not Needed

When developing PHP scripts, I often find people logging ‘bugs’ about missing closing PHP tags. i.e. ?>
I want to make something clear, this is not a requirement unless you plan to stop PHP and output HTML. The following is a 100% valid PHP file:
<?php
echo “Hello, World!”;

Why do it? The best reason of all is to [...]

Quick function lookup on PHP.net

This is a quick and very handy method for looking up functions on php.net. As a PHP programmer, you’ll find yourself constantly consulting the php.net website. Often arguments are in different orders with different functions and it can be hard to remember them all. PHP.net has a convienent method for looking up functions.
To look up [...]

How to display HTML source code

Problem: You want to display HTML on your website so that your visitors can see it. E.g. You might have a tutorial page.
Solution: Use the htmlspecialchars function.
This function will encode all characters in the string passed into it so that the final output will be displayed literally on a HTML page.
For example:
If you just placed [...]