导航菜单
首页 >  PHP PHP tags  > PHP Tags

PHP Tags

PHP TagsPHPServer Side ProgrammingProgramming

Definition and Usage

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 tags

PHP 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

Example

 Live Demo

Output

This will produce following result −

Hello World

PHP supports a short echo tag Output

This will produce following result −

Hello World

Example using short tags

Example

 Live Demo

Output

This will produce following result −

Hello WorldMalhar Lathkar Malhar Lathkar

Updated 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 Career

Get certified by completing the course

Get StartedAdvertisements

相关推荐: