PHP

WHAT ARE DELIMITERES IN PHP

(simple examples)

<?php is used to mark "start of script".

DELIMITERS IN PHP

01

<?php $foo = "bar"; echo $foo; ?>

?> is used to mark "end of script".

MULTIPLE DELIMITERS

02

Whatever is inside <?php ?> will be processed as PHP script.

<?php $title = "TEST"; $txt = "<h1>PAGE</h1>"; ?> <!DOCTYPE html> <html>   <head>     <title><?php echo $title; ?></title>   </head>   <body><?php echo $txt; ?></body> </html>

Whatever is outside will output as it is.

PHP SHORT ECHO TAG

03

Use <?=$VAR?> to quickly output a PHP variable.

<?php $foo = "bar"; ?> <p><?=$foo?></p>