Welcome Guest, Not a member yet? Register   Sign In
php array to javascript array
#1

[eluser]Todlerone[/eluser]
Hello everyone and TY in advance. I'm using jqplot on my website and what I need to do is convert a php array to a javascript array. I have tried json_encode() but the JS array stays empty. My php array looks like this:

$data['x_axis'] = Array ( [0] => Array ( [jcc_qa_id] => 49
[jcc_qa_date] => 2010-07-21
[jcc_qa_type] => cones
[jcc_qa_rescan] => no
[jcc_qa_x] => 0.09205
[jcc_qa_y] => -0.19108
[jcc_qa_z] => -0.20199),...)

There is alot of data, this is the structure of each entry. I want to make three javascript arrays corresponding to the x, y and z php values. Any guidance would be appriaciated.







[/code]
#2

[eluser]Cristian Gilè[/eluser]
What doesn't work with json_encode() ? Please, post your code.


Cristian Gilè




Theme © iAndrew 2016 - Forum software by © MyBB