Heredoc Syntax

By using the syntax, we can display the HTML elements through PHP Script.

Syntax

snippet
<<<name of string
	//content
name of string

Example 1

snippet
<?php
	echo <<<javatpoint
	welcome to the best tutorial site
javatpoint;
?>

Output:

Heredoc Syntax

Example 2

Save as string.php

Heredoc Syntax

Output:

Heredoc Syntax
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents