note 86875 added to control-structures.alternative-syntax
| From: | mido_alone2001 at yahoo dot com | Date: | Fri, 07 Nov 2008 14:05:19 +0000 |
| Subject: | note 86875 added to control-structures.alternative-syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146283@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 ;?> 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/86875
Del: integrated -- https://master.php.net/note/delete/86875/integrated
Del: useless -- https://master.php.net/note/delete/86875/useless
Del: bad code -- https://master.php.net/note/delete/86875/bad+code
Del: spam -- https://master.php.net/note/delete/86875/spam
Del: non-english -- https://master.php.net/note/delete/86875/non-english
Del: in docs -- https://master.php.net/note/delete/86875/in+docs
Del: other reasons-- https://master.php.net/note/delete/86875
Reject -- https://master.php.net/note/reject/86875
Search -- https://master.php.net/manage/user-notes.php