Cita:
Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in C:\AppServ\www\cometchat\php4functions.php on line 466 y otras lineas mas
Código:
necesito saber como arreglar eso,ese codigo viene del archivo php4functions.php muchas gracias if (class_exists('PEAR_Error')) { class Services_JSON_Error extends PEAR_Error { function Services_JSON_Error($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { parent::PEAR_Error($message, $code, $mode, $options, $userinfo); } } } else { class Services_JSON_Error { function Services_JSON_Error($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { } } } if( !function_exists('json_encode') ) { function json_encode($data) { $json = new Services_JSON(); return( $json->encode($data) ); } } if( !function_exists('json_decode') ) { function json_decode($data) { $json = new Services_JSON(); return( $json->decode($data) ); } } if (!function_exists('str_ireplace')) { function str_ireplace($find,$replace,$string) { if(!is_array($find)) $find = array($find); if(!is_array($replace)) { if(!is_array($find)) $replace = array($replace); else { $c = count($find); $rString = $replace; unset($replace); for ($i = 0; $i < $c; $i++) { $replace[$i] = $rString; } } } foreach($find as $fKey => $fItem) { $between = explode(strtolower($fItem),strtolower($string)); $pos = 0; foreach($between as $bKey => $bItem) { $between[$bKey] = substr($string,$pos,strlen($bItem)); $pos += strlen($bItem) + strlen($fItem); } $string = implode($replace[$fKey],$between); } return($string); } }