A PHP code script is a text file having .php extension and is stored on web server. The PHP parser on server looks for special sequence of characters . These are called PHP's opening and closing tags. Statements witihn these two are interpreted by the parser. PHP script within these tags can be embedded in HTML document, so that embedded code is executed on server, leaving rest of the document to be processed by client browser's HTML parser.
SyntaxShort tagsPHP allows a using a shorter representation of opening tag PHP Version
This setting is recommended to be Off for production environment. Use of ASP style tags and has been discontinued since PHP 7.0
Following example shows use of PHP tags
ExampleLive Demo
OutputThis will produce following result −
Hello WorldPHP supports a short echo tag Output
This will produce following result −
Hello WorldExample using short tags
ExampleLive Demo
OutputThis will produce following result −
Hello World Malhar LathkarUpdated on: 19-Sep-2020
8K+ Views
Related ArticlesHow to implement tags in Cypress?How to humanize tags in Django?8 HMTL Tags Essential for SEOWhich HTML tags are self-closing?Difference between link and anchor TagsContainer and Empty Tags in HTMLHow to import the tags in Azure?What are JSTL formatting tags in JSP?What are JSTL Core tags in JSP?innerHTML adds text but not HTML tagsDisable browser caching with meta HTML tagsCanonical Tags: A Simple Guide for BeginnersFind the siblings of tags using BeautifulSoupDocker Image tags and how to use themWhere should I put tags in HTML markup?Kickstart Your CareerGet certified by completing the course
Get StartedAdvertisements