Undefined variable

Please help to resolve this problem. Im not programmer but im really need help to fix this problem.

if( TP_MASONRY )
{
$this->item->text = JFilterOutput::ampReplace($this->item->text);
preg_match_all("/<img[^>]*>/Ui", $this->item->text, $txtimg);
if (!empty($txtimg[0])) {
foreach ($txtimg[0] as $txtimgel) {
$this->item->text = str_replace($txtimgel,"",$this->item->text);
if ( $n == 0 )
{
preg_match_all("#src="([:-/_A-Za-z0-9.]+)"#",$txtimgel,$txtimgelsr);
$this->item->img = ( !empty( $txtimgelsr[1][0] ) ) ? $txtimgelsr[1][0] : null;
}

}
}
}

Undefines variable: if ( $n == 0 )

Thanks in advance

This variable $n must be defined somewhere above this comparison. Or, just turn off notices using error_reporting setting in php.ini

Sponsor our Newsletter | Privacy Policy | Terms of Service