PHP Syntax
- Default syntax
- Short open Tags
- HTML Script Tags
- ASP Style Tags
Syntax -
Syntax - The rules that must be followed to write properly structured code.
PHP's syntax and semantics are similar to most other programming languages (C, Java, Perl) with the addition that all PHP code is contained with a tag, of sorts.
PHP's syntax and semantics are similar to most other programming languages (C, Java, Perl) with the addition that all PHP code is contained with a tag, of sorts.
PHP opening and closing Tags syntax
There are four different pairs of opening and closing tags which can be used in php. Here is the list of tags.
Default Syntax
The default syntax starts with "
Example : <?php " and ends with " ?> "<?php?> ?>Short open Tags
The short tags starts with "
Example : <? " and ends with " ?> ". Short style tags are only available when they are enabled in php.ini configuration file on servers.<?php?>HTML Script Tags
HTML script tags look like this :
Example :<script type='php'> </script>ASP Style Tags
The ASP style tags starts with "
Example : <% " and ends with " %> ". ASP style tags are only available when they are enabled in php.ini configuration file on servers.<%<%>
No comments:
Post a Comment