Articulos PHP
- 2.8 Usar funciones para código redundante.
- 2.3 Ciclo FOR avanzado.
- 2.2 Ciclo FOR.
- 2 Enunciados if.
- 2.9 Fecha y Hora en PHP.
Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 128
Articulos Jquery
- 2.1 El selector $(this).
- 3.1 Callback en Jquery
- 2.5 Recorriendo el array con each().
- 1 Jquery
- 1.5 El evento keypress
Warning: Use of undefined constant jquery - assumed 'jquery' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 137
Articulos CSS
- 1.2 Estructura de los estilos CSS.
- 1 Hojas de estilo CSS.
- 1.1 Como incluir estilos en una página web.
Warning: Use of undefined constant css - assumed 'css' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 146
Articulos Mysql
- 2.5 Seleccionando filas con NOT LIKE.
- 1.2 Función AVG().
- 3.2 Tipos de datos en MySQL.
- 3 Actualizar valores con UPDATE.
- 2.1 Seleccionando registros con BETWEEN y WHERE
Warning: Use of undefined constant mysql - assumed 'mysql' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 155
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 199
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
2.3 Ciclo FOR avanzado.            Â
Ahora, ya se ha explicado el ciclo FOR en su forma sencilla, sin embargo, también en posible declarara el ciclo FOR de una forma más compleja, por ejemplo, podrÃamos declarar 2 variables como contadores, dos condiciones finales, o bien, 2 incrementos, como sigue:
$suma=0;
for($a=0,$b=10;$suma<=20;a+=2,b+=3){
$suma=$a+$b;
echo “La suma es ”.$suma.”<br/>”;
}
Como se puede ver en el ejemplo anterior se ha declarado una variable $suma con un valor inicial de 0, el cual irá incrementando en cada iteración que se vaya realizando, el ejemplo anterior genera el siguiente output:
La suma es 10
La suma es 15
La suma es 20
La suma es 25
La razón porque $suma llega hasta 25 es porque antes de la última iteración, $suma vale 20 y por tanto se ejecuta una suma más.
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
Ciclo FOR avanzado.
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
2.3