lunes, 7 de enero de 2008

PHP: 10 things you may not know

10 things you (probably) didn’t know about PHP.

Great post on Rightbrainnetworks.com. Of particular interest is the reference to the Ternary Operator. Put simply if you are using an "IF" loop, and only testing two conditions, instead of using:

"if (condition1 == "set")
{
$variable = 1
}
else
{
$variable = 2
}

you can use:

$variable = (condition1 == "set") ? 1 : 2;

No hay comentarios:

Publicar un comentario