Friday, 1 September 2017

php - Parse error: syntax error, unexpected '?>', expecting function (T_FUNCTION)

I have everything correct and I have closed ?> the php tag and it still shows the error:




Parse error: syntax error, unexpected \'?>\', expecting function (T_FUNCTION)




This is my code:




class IWP_MMB_ErrorLog extends IWP_MMB_Core {

function __construct() {
parent::__construct();
}


function get_errorLog($args) {
$myfile = fopen(ini_get('error_log'), "r") or die("Unable to open file!");
// Output one line until end-of-file
while (!feof($myfile)) {
$string = fgets($myfile);
$ar = explode("]", $string);
if (!empty($ar[0])) {
$remove = trim($ar[0], "[");
$remove1 = trim($remove, "UTC");
}
if (!empty($ar[1]) && !empty($ar[0])) {
$error_data[] = array(
'date' => $remove1,
'content' => $ar[1],
);
}
}
fclose($myfile);
return $error_data;
}
}

?>

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...