Manual php
PH P 4
Manual Realizado por: Gabriel Merín Cubero
ÍNDICE
1.- CONCEPTOS BÁSICOS __________________________________________________ 5 1.1.- Insertar código PHP en HTML _________________________________________ 5 1.2.- Múltiples scripts PHP en un mismo documento ___________________________ 6 1.3.- Comentar el código PHP ______________________________________________ 6 2.-TIPOS DE DATOS Y VARIABLES__________________________________________ 8 2.1.- Enteros ____________________________________________________________
_ 8 2.2.- Números en coma flotante _____________________________________________ 8 2.3.- Cadenas ____________________________________________________________
8 2.4.- Conversión de cadenas _______________________________________________ 10 2.5.-Arrays (vectores)____________________________________________________ 11 ARRAYS UNIDIMENSIONALES ________________________________________ 11 ARRAYS MULTIDIMENSIONALES______________________________________ 13 MEZCLANDO ARRAYS ESCALARES Y ASOCIATIVOS ____________________ 15 2.6.- Boolean_____________________________________________________
_______ 18 2.7.- Objetos____________________________________________________________
19 2.8.- Identificadores_____________________________________________
_________ 21 2.9.- Variables __________________________________________________________ 21 ÁMBITO DE LAS VARIABLES__________________________________________ 21 TYPE JUGGLING (JUEGO DE TIPOS) ____________________________________ 24 TYPE CASTING (FORZADO DE TIPOS) __________________________________25 ASIGNACIÓN POR VALOR Y POR REFERENCIA _________________________ 25 VARIABLES VARIABLES ______________________________________________ 26 CONSTANTES__________________________________________________
______ 27 VARIABLES PREDEFINIDAS ___________________________________________ 28 3.- OPERADORES Y ESTRUCTURAS DE CONTROL ___________________________ 31 3.1.- Expresiones________________________________________________________ 31 OPERANDOS___________________________________________________
______ 31 OPERADORES__________________________________________________
______ 31 3.2.- Operadores ________________________________________________________ 31 PRECEDENCIA DE OPERADORES ______________________________________ 31 OPERADORES ARITMÉTICOS__________________________________________ 32OPERADORES DE ASIGNACIÓN _______________________________________ 32 OPERADORES DE INCREMENTO/DECREMENTO_________________________ 33 OPERADORES LÓGICOS ______________________________________________ 33 OPERADORES DE COMPARACIÓN _____________________________________ 34 OPERADORES BIT A BIT ______________________________________________ 34 OPERADOR DE EJECUCIÓN ___________________________________________ 34OPERADORES DE CADENAS __________________________________________ 35 3.3.- Estructuras de Control _______________________________________________ 35 if ____________________________________________________________
_______ 35 else________________________________________________________
__________ 35 elseif ____________________________________________________________
____ 36 SintaxisAlternativa de Estructuras de Control ________________________________ 36
Página 2/115
while ____________________________________________________________
____ 37 do..while ____________________________________________________________
_ 37 for ____________________________________________________________
______ 38 foreach_____________________________________________________
__________ 39switch ____________________________________________________________
___ 40 break ____________________________________________________________
____ 42 continue ____________________________________________________________
__ 42 4.- FUNCIONES __________________________________________________________ 44 4.1.- ¿Qué es una función? ________________________________________________ 44 4.2.-...
Regístrate para leer el documento completo.