If-statements (PHP)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Paar voorbeelden:

# Basis
##########################
#
if (condition) 
{
    code to be executed if condition is true;
} # Geen ";"!
# Vergelijking van strings
##########################
#
if (sku1==sku2)
{
   ...
}
# AND-clause
##########################
#
<?php

$a=5;
$b=5;
$c=5;

if ($a==$b and $a==$c)
{
	echo "a=b=c";
}


$a=5;
$b=5;
$c=4;

if ($a==$b and $a==$c)
{
	echo "a=b=c";
}
elseif ($a==$b and $a<>$c)
{
	echo "a=b<>c";
}