The following programme is an easy-to-use PHP application that displays "Hello World!."
The PHP parsing engine needs the means to distinguish PHP from other items on the page. It is called 'escaping to PHP' as this is done. This can be done in four ways :
The PHP tag style is the most universally effective −
You may rest assured that your tags are always correctly translated when you use this style.
This seems like short or short-open tags –
Short tags are the shortest option, as one could imagine. To allow PHP to recognise the tag, you need to do two things.
The ASP tags imitate the tags used for delineating code sections by Active Server Pages. Such are the ASP-style tags –
You must specify the configuration option in your php.ini file to use the ASP-style tags.
This looks like HTML script tags –
One comment is that part of a programme which is only available to the human reader and removed before showing the outcome of the programmes. PHP has two commenting formats − Single-line comments − They are generally used for brief explanations or local code notes. Examples of one-line comments are provided below.
|