note 86876 deleted from control-structures.alternative-syntax by danbrown

From: Date: Fri, 07 Nov 2008 14:11:34 +0000
Subject: note 86876 deleted from control-structures.alternative-syntax by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-146285@lists.php.net to get a copy of this message
Note Submitter: mido_alone2001 at yahoo dot com ---- Hello , when you going to make a script , you must try easist way to do and fastest way to parse .. using alternative-syntax is very useful to shorten your code e.g : If you want to do : <?php $a=1 ; if ($a=1) { echo "<table border=1><tr><td>$a is equal to one </td></tr></table> " ; } ?> You can do it using alternative-syntax as following : <?php $a=1 ; if ($a=1) :?> <table border=1><tr><td><?echo $a ;?> &nbsp;is equal to one </td></tr></table> <?php endif ; ?> So the HTML code Won't excuted until the condition is true

« previous php.notes (#146285) next »