| operador | descripción | ejemplo ( x = 2) | |
| comparación | resultado | ||
| == | igual a | x == 3 | FALSE |
| x == 2 | TRUE | ||
| x == "2" | TRUE | ||
| === | igual en valor y tipo | x === 2 | TRUE |
| x === "2" | FALSE | ||
| != | no igual | x != 3 | TRUE |
| !== | no igual ni en valor ni en tipo | x !== 2 | FALSE |
| x !== "2" | TRUE | ||
| x !== 3 | TRUE | ||
| > | mayor a | x > 3 | FALSE |
| < | menor a | x < 3 | TRUE |
| >= | mayor o igual a | x >= 3 | FALSE |
| <= | menor o igual a | x <= 3 | TRUE |
sábado, 25 de junio de 2016
Operadores Lógicos de JS: Comparaciones
miércoles, 8 de junio de 2016
PHP - ver si un string contiene un caracter
cómo ver si una cadena ó string contiene un caracter? strpos()
$dirPai = htmlspecialchars($_REQUEST["dirPai"] );
if (strpos($dirPro, '-') !== false) {
if (phpversion () < "5"){
list($idPais, $nomPais) = split('[/.-]', $dirPai);
}else{
list($idPais, $nomPais) = explode('-', $dirPai);
}
}else{
$nomPai = $dirPai;
}
Suscribirse a:
Entradas (Atom)