php引号问题

WBOY
WBOYOriginal
2016-06-23 13:19:39849browse

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


回复讨论(解决方案)

用htmlspecialchars解决了

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