ELD
September 1st, 2010, 04:08 PM
class video
{
public function __construct($text)
{
$this->youtube($text, "
");
}
public function youtube($text, $code)
{
$html = preg_replace("#\[\*\]#", $text, $code);
return $html;
}
}
$video_class = new video("HELLO");
echo $video_class;
Can anyone explain what that would error out with:
Catchable fatal error: Object of class video could not be converted to string in /home/prxainf1/public_html/gamingonlinux.info/test.php on line 21
{
public function __construct($text)
{
$this->youtube($text, "
");
}
public function youtube($text, $code)
{
$html = preg_replace("#\[\*\]#", $text, $code);
return $html;
}
}
$video_class = new video("HELLO");
echo $video_class;
Can anyone explain what that would error out with:
Catchable fatal error: Object of class video could not be converted to string in /home/prxainf1/public_html/gamingonlinux.info/test.php on line 21