Join Up!
104886 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousTags de inicio y finsintáxis de while (mientras)next
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to German

sintáxis de if..endif

La manera `alternativa' de escribir la declaración if/elseif/else, usando if();elseif(); else; endif; no puede implementarse eficientemente sin agregar una gran complejidad al intérprete 3.0. Por eso la sintáxis ha cambiado:

Ejemplo C-5. Migración: vieja sintáxis if..endif

if ($foo);
    echo "sip\n";
elseif ($bar);
    echo "casi\n";
else;
    echo "nop\n";
endif;

Ejemplo C-6. Migración: nueva sitáxis if..endif (si...finsi)

if ($foo):
    echo "sip\n";
elseif ($bar):
    echo "casi\n";
else:
    echo "nop\n";
endif;
Nótese que los punto-y-coma, han sido reemplazados por los los dos-puntos en todas las declaraciones, excepto en la de finalización (endif).

User Contributed Notes
sintáxis de if..endif
add a note about notes
There are no user contributed notes for this page.
previousTags de inicio y finsintáxis de while (mientras)next
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST