Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/04/2006, 09:24
Avatar de mauled
mauled
 
Fecha de Ingreso: marzo-2005
Ubicación: Cd. de México.
Mensajes: 3.001
Antigüedad: 19 años, 2 meses
Puntos: 33
Prueba lo siguiente

Código PHP:
<?php
class Contador{

var 
$cont;
var 
$temp;
function 
Contador(){
$this->cont =0;
$this->temp0;
}
function 
incrementar(){
$this->cont$this->cont +1+$this->temp;
$temp $this->cont;
echo 
"aqui"$this->cont;
}
function 
getContador(){
return 
$this->cont;
}
}
?>
<?php
$c
=new Contador();
$c->incrementar();
//echo $c->getContador();
$c->incrementar();
//echo $c->getContador();
?>

Última edición por mauled; 24/04/2006 a las 11:14