PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

syntaxe while> <Otvírací/uzavírací značky (start/end tags)
Last updated: Sat, 24 Mar 2007

view this page in

syntaxe if..endif

Alternativní způsob, jak zapsat konstrukci if/elseif/else, za použití if(); elseif(); else; endif;, nemůže být efektivně implementována bez podstatného nárůstu složitosti 3.0 parseru. Kvůli tomu se změnila syntaxe:

Příklad E.5. Přechod: stará syntaxe if..endif

if ($foo);
    echo "yep\n";
elseif ($bar);
    echo "almost\n";
else;
    echo "nope\n";
endif;

Příklad E.6. Přechod: nová syntaxe if..endif

if ($foo):
    echo "yep\n";
elseif ($bar):
    echo "almost\n";
else:
    echo "nope\n";
endif;

Všimněte si, že středníky byly nahrazeny dvojtečkami ve všech příkazech kromě závěrečného (endif).



add a note add a note User Contributed Notes
syntaxe if..endif
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites