Saturday, September 30, 2017

PHP Delimiters





What are PHP delimiters?

     Php delimiters are used to embed PHP code on an HTML web page.  

     The four main methods for marking PHP code in a page are like this. Here is the default method <?php "CODE"; ?>, the shorthand version <? "CODE"; ?>, the script version which is like this <script language = "php> "CODE"; </script> , and the ASP method like this <% "CODE"; %>.  

     The problem with the short tag syntax (<? "CODE"; ?>) is that it has to be enabled using a short_open_tag directive and some servers might not be configured execute the shorthand. However short tag syntax could save you some time if you don't like typing out the default tag.  

     This script tag (<script language = "php> "CODE"; </script>) is beneficial if you have an editor that doesn't do well with the standard delimiter syntax, but it can take longer to type so it might be beneficial to find a new editor if you have trouble using default escape tags.  

     The ASP method (<% "CODE"; %>) is used to separate dynamic PHP from static however it is recommended that you do not use the ASP method because it is a not a common delimiter and might cause problems.  

Thanks for reading.  

Check out this Truth or Dare game.
https://play.google.com/store/apps/details?id=com.calebsapps.mynam.truthordare
References:

Featured Post

Washington State Poisonous Toad

The Western Toad pictured above can be green or brown and is always covered in warts.  (This is the frog he tried to eat) One w...