Join Up!
104887 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousKontroll-Strukturenelseifnext
Last updated: Mon, 28 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Finnish | Spanish

else

Häufig ist es erforderlich, eine Anweisung auszuführen, wenn eine bestimmte Bedingung erfüllt ist und eine andere Anweisung, falls sie nicht erfüllt ist. Dafür gibt es else. Else erweitert eine if-Anweisung um die Ausführung von Anweisungen, sobald der Ausdruck der if-Anweisung als FALSE ausgewertet wird. Der folgende Code wird z.B. a ist größer als b anzeigen, wenn $a größer ist als $b, anderenfalls a ist NICHT größer als b:

if ($a > $b) {
    print "a ist größer als b";
} else {
    print "a ist NICHT größer als b";
}

Die else-Anweisung wird nur ausgeführt, wenn der if-Ausdruck als FALSE ausgewertet wurde und wenn bei vorhandenen elseif-Ausdrücken diese ebenfalls FALSE sind (siehe elseif).

User Contributed Notes
else
add a note about notes
There are no user contributed notes for this page.
previousKontroll-Strukturenelseifnext
Last updated: Mon, 28 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