I have the following array in PHP
Array
(
[0] => Array
(
[Funcionarios] => Array
(
[id] => 3
[nome] => Funcionario Teste
[assistmed] => 10
[assistodont] => 1
)
)
[1] => Array
(
[Funcionarios] => Array
(
[id] => 1
[nome] => Paulo Teste 2
[assistmed] => 2
[assistodont] => 2
)
)
I need to turn it into JS.
I tried
js_arr = JSON.parse('<?php echo JSON_encode($funcionarios2);?>');
And I would like to handle it with js. But I can not get the data, I tried the following commands:
alert(js_arr.id[0]);
alert(js_arr[id][0]);
What is the right way?