PHP array_push错误为“ Unexcepted T_STRING”

时间:2019-03-14 19:03:22

标签: php

<?php

require 'init.php' ;
$sql = "select * from contacts  ;
$result = mysqli_query($con ,$sql);
$response = array();

while($row = mysqli_fetch_array($result))
{
    array_push($response,array("name"=>$row['name'],"email"=>$row['email']));
}

echo json_encode($response) ;
mysqli_close($con);

?>

他们的错误发生在最后3行...错误是“ unknownd T_STRING”

0 个答案:

没有答案