-1

I am new to web development and I am using symfony2 for this project I am working on.

Have a template file called view.html.php and Inside this I have a JavaScript portion, inside which I want to assign JavaScript variable to PHP variable..I tried to do the following way but it did not work. Could some one please help me out with this.

<script>
  ....
  var temp=json;

   //error below
  <?php $jsonobj= = temp ?> 
  ...
</script>
4

1 回答 1

0

大行

让您的 php 从通过 js 提供此变量的页面中获取您的值,然后将其分配给您的 php var

明白我的意思吗?

于 2012-08-13T13:01:00.337 回答