Home > Backend Development > PHP Tutorial > php引号问题

php引号问题

WBOY
Release: 2016-06-23 13:19:39
Original
859 people have browsed it

<?php echo '<img src="" alt="'.$activityRow["photo_title_en"].'"  ';?>因为$activityRow["photo_title_en"] 里有双引号所以<img  sdsdsd\""="" alt="\" src="">   alt="" 里的内容跑出来用addslashes处理变量也不行如何将 $activityRow["photo_title_en"]内容里的双引号转为  &gt 显示或者有其它更好的方法分享下
Copy after login


回复讨论(解决方案)

用htmlspecialchars解决了

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