Categories

if…else

Guillaume Dumas März 18, 2016
No votes yet.
Please wait...

Very often when you write code, you want to perform different actions for different conditions. You can use conditional statements in your code to do this.

The if….else statement executes some code if a condition is true and another code if that condition is false.

The if….else syntaxt in PHP is similar to the one in JavaScript and any other C-like language.

if (condition) {
    code to be executed if condition is true;
} else {
    code to be executed if condition is false;
}

The condition can be any expression that result into a boolean value (true or false), for example:

if ($number_of_posts > 9) {
    show_breadcrumbs();
}
Bookmarken den permalink.

Submit a ticket

Sollte Ihre Frage durch die Tutorials nicht ausreichend beantwortet worden sein, benutzen Sie bitte den folgenden Link, um sich an unser Beratungsteam (Support) zu wenden. Wir bieten Ihnen unsere Hilfe und Unterstutzung an. 24 Stunden am Tag, 7 Tage die Woche!
Ticket Einrichten

Kommentare sind geschlossen