超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<fgetsfile_exists>
Last updated: Fri, 22 Jun 2007

fgetss

(PHP 3, PHP 4 , PHP 5)

fgetss -- 从文件指针中读取一行并过滤掉 HTML 标记

说明

string fgetss ( resource handle, int length [, string allowable_tags])

fgets() 相同,只除了 fgetss 尝试从读取的文本中去掉任何 HTML 和 PHP 标记。

可以用可选的第三个参数指定哪些标记不被去掉。

注: allowable_tags 是 PHP 3.0.13,PHP 4.0.0 新加的。

注: 如果碰到 PHP 在读取文件时不能识别 Macintosh 文件格式,可以激活 auto_detect_line_endings 的运行时配置选项。

参见 fgets()fopen()fsockopen()popen()strip_tags()




add a note add a note User Contributed Notes
fgetss
dragonzap1 at aol dot com
29-Jun-2000 10:32
fgetss() doesn't quite work right on HTML files with tags spanning more than one line. I'm assuming that this is because it only takes the file one line at a time. If you want to strip all HTML tags from a file, use $file_text = strip_tags(join('',file($filename))) instead. (You may also wish to split()/explode() it by "\n" after.)

<fgetsfile_exists>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22