This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Uso de funciones anónimas: | |
// Definiendo la primera función anónima y asignandolo a $manejador1 | |
$manejador1 = function($num1, $num2){return $num1 + $num2;}; | |
// Definiendo la segunda funcion y asignandola a $manejador2 | |
$manejador2 = function($num1, $num2) {return $num1 * $num2;}; | |
// Haciendo las llamadas a las funciones. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Algunas variables | |
$valor_nombre = 'Hola Mundo!'; | |
$nombre_variable = 'valor_nombre'; | |
$nombre_variable_que_tiene_nombre = 'nombre_variable'; | |
// Utilizando variables variables | |
// Primer ejemplo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- La cuenta A y C serán cargadas (se les quitará) y | |
-- la cuenta B será abonada (se le sumará) | |
-- Inicio de la transacción | |
BEGIN; | |
-- Cargando la cuenta A. | |
UPDATE cuentas SET saldo_cuenta = saldo_cuenta - monto_a WHERE nombre_cuenta = 'A'; | |
-- Cargando la cuenta C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- La cuenta A será cargada (se le quitará) y | |
-- la cuenta B será abonada (se le sumará) | |
-- Inicio de la transacción | |
BEGIN; | |
-- Cargando la cuenta A. | |
UPDATE cuentas SET saldo_cuenta = saldo_cuenta - monto WHERE nombre_cuenta = 'A'; | |
-- Abonando la cuenta B. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- La cuenta A será cargada (se le quitará) y | |
-- la cuenta B será abonada (se le sumará) | |
-- Inicio de la transacción | |
BEGIN; | |
-- Cargando la cuenta A. | |
UPDATE cuentas SET saldo_cuenta = saldo_cuenta - monto WHERE nombre_cuenta = 'A'; | |
-- Abonando la cuenta B. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Usuario { | |
// Atributos | |
// Id de usuario. | |
private uid; | |
// Login del usuario | |
private login; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// La cadena XML | |
var cadenaXML = '<libro><titulo>XML y jQuery</titulo><autor>Carlos Linares</autor><editorial>La Ceiba</editorial></libro>'; | |
// Transformando la cadena XML en un objeto jQuery. | |
var obj = $.parseXML(cadenaXML); | |
$xml = $(obj); | |
// Una vez creado el objeto, este puede ser manipulado |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Convirtiendo la cadena JSON en un objeto Javacript | |
var objJavascript = $.parseJSON('{"nombre":"Carlos", "Apellido": "Linares", "Dirección": "San Salvador"}'); | |
// Ahora que el objeto ha sido creado, puede ser manipulado fácilmente. | |
// Imprimiendo el nombre | |
alert(objJavascript.nombre); // 'Carlos' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### THIS FILE IS AUTOMATICALLY CONFIGURED ### | |
# You may comment out this entry, but any other modifications may be lost. | |
deb http://dl.google.com/linux/chrome/deb/ stable main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UnaClase{ | |
public function metodoClase($parametro1, $parametro2) | |
{ | |
echo 'Esta función solo imprime este msj'; | |
return TRUE; | |
} | |
} // Fin de la clases | |
?> |