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));
}

就好了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章