我有一個PHP文件,給了我需要作爲一個字符串的響應,我需要它是一個數組編碼在JSON中,即時通訊不是很好與PHP,可以任何一個幫幫我 ? 這是它如何工作的罰款作爲字符串 - printf("user: \"%s\" \"%s\" email: \"%s\" \n", $row['firstname'], $row['lastname'],$row['email']);
php文件,返回一個字符串JSON編碼沒有工作
但我需要它作爲JSON數組這就是我試圖做到這一點 - array_push($mynewArray,array("firstname \%s"=>$row['firstname'],"lastname \%s"=>$row['lastname'],"email \%s"=>$row['email'])); echo json_encode($mynewArray);
this is the screen shot that shows how i tried to do it
使用表單'的數組鍵姓名\%s'可能不會做出最有意義... – CBroe