FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » JSON variabiles
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
JSON variabiles [message #178877] Fri, 17 August 2012 14:54 Go to previous message
Sarah is currently offline  Sarah
Messages: 30
Registered: December 2010
Karma:
Member
Hi, I use this code

$data['code'][] = $result;
Header('Content-type: application/json');
echo json_encode($data);
exit;

For return a value using JSON.

{"code":["202"]}

(1 value returned)

Now I would like to return not only 1 value but 2 (2 variables)



How can I return another value? First value $result, second value $second

$data['code'][] = $result; //questa รจ la prima variabile passata
$data['code'][] = ???? //How can I pass also $second variabile for return 2 values in JSON?

Thanks
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Free service to allow large file upload in PHP forms
Next Topic: PHP Session Variable
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 03:15:35 GMT 2024

Total time taken to generate the page: 0.03660 seconds