PHP script is executed on server, it check for opening and closing tags (<?php ?>), outside of the code from PHP tags ignored by the PHP parser.
PHP script starts with "<?php" and end with "?>", PHP parser also allow short open tag <?, it is allow when "short_open_tag" is enabled in PHP.ini file.
<?php echo "Hello World";?>
$lang = "PHP"; echo "My favourite language is " . $lang; //Output:: My favourite language is PHP echo "My favourite language is " . $Lang; //Notice: Undefined variable: Lang echo "My favourite language is " . $LANG; //Notice: Undefined variable: LANG //CONSTANT define('WEBSITE','qoify.com'); echo Website; //Notice: Use of undefined constant Website - assumed 'Website'
All there statements are same.
$lang = "PHP"; echo $lang; // PHP ECHO $lang; // PHP ecHo $lang; // PHP
PHP parser is ignored outside of PHP opening and closing tags
<p><h1>HTML Heading</h1></p> <?php echo "PHP Code"; ?> <p>HTML code ingnored by PHP Parser</p>
<?php if($check==1): ?> This part will show if condition is TRUE <?php else: ?> This part will show when condition is FALSE <?php endif; ?>