Articulos PHP
- 2.5 Saliendo del ciclo con BREAK.
- 2.8 Usar funciones para código redundante.
- 2 Enunciados if.
- 1.8 Arreglos o array.
- 3.1 Conexión MySQL con enunciado die.
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.6 El efecto fadeIn y fadeOut.
- 2.7 Listas desplegables con change()
- 1.8 Creando elementos con Jquery
- 1.2 Usar CDN para utilizar Jquery
- 1.6 El método preventDefault.
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
- 3 Actualizar valores con UPDATE.
- 1.8 Seleccionando registros con WHERE.
- 3.2 Tipos de datos en MySQL.
- 4 Creando cuentas MySQL.
- 2.6 Combinando resultados con UNION ALL.
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



