Passing array from php to javascript using json_encode
Posted: Mon Sep 30, 2013 11:41 am
Hi,
I tried to pass an array to javascript from PHP using
Whine I try to access the data in JavaScript using
I get the output as
I want to treat each element as array. can anyone please help me how to do that.
Thanks & Regards,
Samir
I tried to pass an array to javascript from PHP using
Code: Select all
echo json_encode($arr_wrd);Code: Select all
xhr.responseText;
Code: Select all
["timekeeping","plover","instability","memorabilia","semidark"]
Thanks & Regards,
Samir