上一篇:查找前一条/后一条记录(附SQL语句)
下一篇:中国的稀土危机
PHP的strip_tags()函数,剔除标签,返回字符串
米娅 2010年11月9日 19:11:00

PHP的strip_tags()函数,剔除标签,返回字符串

例子:

<?php
$text = '<p>the link.</p><!-- Comment --> <a href="#">click here</a>';
echo strip_tags($text);
echo "\n";

// 允许 <p> 和 <a>
echo strip_tags($text, '<p><a>');
?>

输出:

the link.click here.
<p>the link.<p><a href="#">click here</a>



2楼 2010年11月9日 19:52:51 米娅

把代码包含在下面的标签里,网页显示效果可能好些:

<code></code>

<PRE></PRE>

第1页 共1页
相关链接
1. Drupal 7.19: Notice: Undefined index: description in simpletest_test_form()
2. 手机卡成功剪卡装进iphone 5
3. iPhone 5 YouTube视频无法播放(已解决)
4. 整站下载工具WebZip
5. 如何用Adobe Flash CS4和ActionScript 3.0添加超级链接(附代码)
6. 学习Adobe Flash ActionScript的推荐链接
7. 网页右键禁用JavaScript代码
8. 下载Eclipse的链接
9. 应用Ajax、PHP、javascript来实现异步操作
10. 加拿大邮票: Canadian Diplomacy (2009)
11. 在eBay上卖东西(7):如何合并邮包优惠邮费(combine the shipping fee)
12. 在eBay上卖东西(3):什么是Print a shipping label
13. Boxing Day的多伦多Nathan Phillips广场(摄影)
14. iphone里的内置指南针定位
15. javascript中的冒号作什么用
16. 用javascript判断字符串是否为正整数