1
Array ( [0] => Array ( [faq_id] => 14 [faq_faqcat_id] => 3 [faq_order] => 8 [faq_subject] => 800018 [faq_content] => 800019 [faq_datecreated] => 1213382678 [faq_dateupdated] => 1215547984 [faq_views] => 22 ) [1] => Array ( [faq_id] => 15 [faq_faqcat_id] => 3 [faq_order] => 9 [faq_subject] => 800020 [faq_content] => 800021 [faq_datecreated] => 1213382698 [faq_dateupdated] => 1215547986 [faq_views] => 13 ) [2] => Array ( [faq_id] => 16 [faq_faqcat_id] => 3 [faq_order] => 10 [faq_subject] => 800022 [faq_content] => 800023 [faq_datecreated] => 1213382711 [faq_dateupdated] => 1215547988 [faq_views] => 15 ) ) 

The above data is output of a PHP script. I have to convert this to a JSON object and show on an iPhone. can anyone please tell how?

0

2 Answers 2

6

Take a look at the json_encode and json_decode functions

For the parsing part on iOS you can use the native NSJSONSerialization class.

Sign up to request clarification or add additional context in comments.

Comments

0

Dunno about iOS side, but from PHP it's pretty simple

http://php.net/manual/en/function.json-encode.php

echo json_encode($myArray); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.