I want to convert my database query’s result array to JSON format in PHP. Here is my code:
$row = mysql_fetch_array($result)
I want to convert $row to JSON format and pass the JSON data to a jQuery plugin.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
json_encodeis available in php > 5.2.0:echojson_encode($row);