Home  >  Article  >  Backend Development  >  js中套php,js退出php的foreach退不出来,该怎么解决

js中套php,js退出php的foreach退不出来,该怎么解决

WBOY
WBOYOriginal
2016-06-13 10:46:01750browse

js中套php,js退出php的foreach退不出来
如题,代码如下:(红色部分退不出来)



------解决方案--------------------
楼主理解有问题。服务器端只认识PHP代码,它“看到”的只是PHP代码而已,只负责运行PHP代码,以下面这个片段为例:
nid=;
if(id==nid){
break; ?>
alert("==");
服务器只能“看到”下面两行代码:

PHP code
echo $n_id;break;<div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn