syntax error, unexpected ')', expecting variable (T_VARIABLE)

syntax error, unexpected ‘)’, expecting variable (T_VARIABLE)

function utc2shanghai(date1){
     
  date_default_timezone_set('Asia/Shanghai');
  // echo $b;
  return date('Y-m-s H:i:s',strtotime(date1));
}

我在写php function的时候遇到了这个错误
改为

function utc2shanghai($date){
     
  date_default_timezone_set('Asia/Shanghai');
  // echo $b;
  return date('Y-m-s H:i:s',strtotime($date));
}

就好了

你可能感兴趣的:(http)