note 86876 added to control-structures.alternative-syntax

From: Date: Fri, 07 Nov 2008 14:05:47 +0000
Subject: note 86876 added to control-structures.alternative-syntax
Groups: php.notes 
Request: Send a blank email to php-notes+get-146284@lists.php.net to get a copy of this message
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 ---- Server IP: 69.147.83.197 Probable Submitter: 84.36.145.63 ---- Manual Page -- http://www.php.net/manual/en/control-structures.alternative-syntax.php Edit -- https://master.php.net/note/edit/86876 Del: integrated -- https://master.php.net/note/delete/86876/integrated Del: useless -- https://master.php.net/note/delete/86876/useless Del: bad code -- https://master.php.net/note/delete/86876/bad+code Del: spam -- https://master.php.net/note/delete/86876/spam Del: non-english -- https://master.php.net/note/delete/86876/non-english Del: in docs -- https://master.php.net/note/delete/86876/in+docs Del: other reasons-- https://master.php.net/note/delete/86876 Reject -- https://master.php.net/note/reject/86876 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146284) next »