Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何将变量从模板{data}传递到要分解的php_Javascript_Php - Fatal编程技术网

Javascript 如何将变量从模板{data}传递到要分解的php

Javascript 如何将变量从模板{data}传递到要分解的php,javascript,php,Javascript,Php,我需要在php中分解这个{{{{data.comment}}}。 我是初学者,谢谢 <span class="um-activity-comment-text"> <?php $comm = '{{{data.comment}}}'; echo explode(' ', $comm)[0]; //--> this is not working. ?> </span> 通过放置`{

我需要在php中分解这个{{{{data.comment}}}。 我是初学者,谢谢

<span class="um-activity-comment-text">
<?php            
        $comm = '{{{data.comment}}}';
        echo explode(' ', $comm)[0]; //--> this is not working. 
        ?>
</span>

通过放置`{}}您已经执行了“echo”,所以请尝试


data.comment是json?脚本标记在哪里?什么模板语言?它怎么会“不起作用”?请阅读。yes data.comment是json。首先,您需要执行json\u解码,结果是datacomment