Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/10/2006, 21:22
migueilichenco
 
Fecha de Ingreso: marzo-2004
Mensajes: 186
Antigüedad: 20 años, 2 meses
Puntos: 0
variables en PHP

Hola a todos, estado probando hacer mis clases y he visto que funcionan igualmente esto:

$variable

y esto:
$this->variable=$variable;
$this->variable;

Pero cual de los dos son mas recomendables, ya que asi trabaj normal sin $this:

Código PHP:
class title
    
{
        function 
__construct($direccion)
            {
                
$expresion="<title>(.*)</title>";
                
$url=fopen($direccion"r");
                while (!
feof ($url))
                    {
                        
$cadena fgets ($url1024);
                        if (
eregi ($expresion$cadena$out)) 
                            {
                        
$title $out[1];
                        echo 
$title;
                        echo 
"\n";
                        break;
                        }
                }
            
fclose($url);    
        }
    } 
__________________
Software a Medida
voip Locutorios

Última edición por migueilichenco; 24/10/2006 a las 21:28