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 animal { | |
function ladra(){ | |
} | |
function cuantoladra($nladra){ | |
$c=1; | |
while ($c <= $nladra) | |
{ |
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 animal | |
{ | |
public $nombre = "perro"; | |
public function ladrar(){ | |
print " woof"; | |
} | |
} | |
class chihuahua extends animal { | |
public function ladrar(){ |
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 ope{ | |
protected $n1; | |
protected $n2; | |
public function __construct($n1, $n2) { | |
$this->n1 = $n1; | |
$this->n2 = $n2; | |
} | |
public function ope() { | |
return $this->n1 - $this->n2; |
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 | |
trait saludo | |
{ | |
public function hola() | |
{ | |
echo "Hola Celeste"; | |
} | |
} | |
trait saludo2 |
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 | |
$miservidor = "127.0.0.1"; | |
$miusuario = "root"; | |
$contra = ""; | |
$mibasededatos = "banco"; | |
//create connection | |
$miconexion = new mysqli($miservidor, $miusuario, $contra, $mibasededatos); | |
//check connection | |
if ($miconexion->connect_error) { | |
die("Fallo la conexion revisa tus datos de conexion !!!: " .$miconexion->connect_error); |
OlderNewer