How to pass PHP array parameter to Javascript Function?

后端 未结 7 1119
囚心锁ツ
囚心锁ツ 2021-01-20 03:48

index.php




        
7条回答
  •  清歌不尽
    2021-01-20 04:32

    
    

    Notice the json_encode, which encodes objects or arrays for Javascript (JSON stands for JavaScript Object Notation) and also notice the ' instead of ", because JSON uses ".

    Although, this soulution would be better:

    
    ...
    
    

提交回复
热议问题