I am working on this code on my PHP server and I keep getting this error but don't know why. Could someone please help. I looked for missing items but I can't find anything.
Parse error: syntax error, unexpected '{' in /home4/johnwilliams/public_html/core/init.inc.php on line 34
<?php
session_start();
error_reporting(E_ALL);
include_once($_SERVER['DOCUMENT_ROOT']."/config/db.inc.php");
foreach ($C as $name => $val) {
define($name, $val);
}
foreach ($B as $name => $val) {
define($name, $val);
}
$dsn = "mysql:host=".DB_HOST.";dbname=".DB_NAME;
$dbo = new PDO($dsn, DB_USER, DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
//$dbo = new PDO($dsn, DB_USER, DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"));
function autoload($class) {
$filename = $_SERVER['DOCUMENT_ROOT']."/class/class.".$class.".inc.php";
if (file_exists($filename)) {
include_once($filename);
}
}
ini_set('session.cookie_domain', APP_HOST);
session_set_cookie_params(0, '/', APP_HOST);
$helper = new helper($dbo);
$auth = new auth($dbo);
static function clearText($text); {
$text = trim($text);
$text = strip_tags($text);
$text = htmlspecialchars($text);
return $text;
}
static function clearInt($value); {
$value = intval($value);
return $value;
}
Line 34 is below:
function autoload($class) {