class Title extends Imoveis
{
public function file_verify($file)
{
global $extension;
$file = explode("/", $file);
$file = $file[1];
$extension = pathinfo($file);
$extension = $extension['extension'];
}
public function define_title()
{
global $extension;
if(isset($extension) && $extension == 'php')
{
return "Bingooooooo";
}
}
}
Tu estás a utilizar OOP
lembra-te de quais opções melhor assentam quando vais resolver problemas de escopo.
class Title extends Imoveis
{
private $extension;
public function file_verify($file)
{
$file = explode("/", $file);
$file = $file[1];
$extension = pathinfo($file);
$this->extension = $extension['extension'];
}
public function define_title()
{
if(isset($this->extension) && $this->extension == 'php')
{
return "Bingooooooo";
}
}
}