Answer the question
In order to leave comments, you need to log in
Convert php object to javascript object?
Tell me how to do it. The problem is simple but not solved.
There is a php object.
<?
$vi = array(
'a'=>1,
'b'=>2
);
?>
var vi = {
a:1,
b:2
};
<?
echo<<<heredoc
<script>
var vi = {
a:1,
b:2
};
</script>
heredoc;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question