How to use an array value from php to javascript?

后端 未结 5 1091
不知归路
不知归路 2020-12-30 14:10

it was always a question for me that how can i use an array value in javascript while that array is defined in my php scripts

For example consider reading some va

5条回答
  •  礼貌的吻别
    2020-12-30 14:34

    JSON is your choice, since some PHP 5.x version, PHP contains a function json_encode().

    
    

    As usual, some nice guys wrote json_encode() functions for older PHP version, checkout the comments on php.net.

提交回复
热议问题