The Basics of PHP

Writing code isn’t very different from writing poetry or prose. It’s just involves a different medium and audience. However, it does have a language of its own complete with grammar, syntax and rules.

If you are using PHP, thanks to a number of functions that it offers, it becomes increasingly obvious finding the right one is critical to your coding efforts. In fact, the simpler your code is, the better it will be.

Among the several benefits that the language of PHP has to offer, probably the three most important of the lot is that PHP is not only cheap, easy to setup but also very popular and inexpensive.

For the designer, who is just getting started with PHP, it will comforting to add that the language is easy to learn , helps in getting work done quickly and with style and offers a number of free scripts, code and documentation.

The syntax, for example, is always enclosed Viagra between the wrappers <?php and ?> for the express purpose of simply informing the PHP engine that everything between these tags should be interpreted as PHP only.

In PHP, comments are used when you want to make a note. All comments when enclosed with /* and */ indicate that everything in between these tags must not be executed.

Variables, which is another important aspect of PHP, is used to store information. In PHP, variables begin with a dollar sign and are followed by a variable name that consists of letters, underscores, and numbers. However, variables cannot begin with numbers.

As for functions, the best part about PHP is the fact that it contains, quite literally, hundreds of built- in functions which can be simply defined as arguments separated by commas and usually gives or returns something as a result. For example, you can use this function, “<?php echo date(‘Y’); ?>” if you want the current year as the output.