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

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

WBOY
Release: 2016-06-13 10:46:01
Original
799 people have browsed it

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



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

PHP code
echo $n_id;break;<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template