fgetss -»ñÈ¡Ïß´ÓÎļþÖ¸ÕëºÍ´ø±ê¼Ç
fgetss
£¨ PHP 4ÖУ¬ PHP 5ÖУ©
fgetss -»ñÈ¡Ïß´ÓÎļþÖ¸ÕëºÍ´ø±ê¼Ç
ÃèÊö
×Ö·û´®fgetss £¨×ÊÔ´$´¦Àí[ÕªÒª$³¤¶È[ £¬×Ö·û´®$ allowable_tags ] ] £©
Ïàͬfgets £¨ £© £¬µ«fgetss £¨ £©ÊÔͼ´øÈκÎHTMLºÍPHP±êÇ©¶ÁÈ¡µÄÎı¾¡£
²ÎÊý
°Ñ±ú
ÎļþÖ¸Õë±ØÐëÓÐЧ£¬±ØÐëÖ¸ÏòÒ»¸öÎļþ³É¹¦´ò¿ªfopen £¨ £©»òÕßfsockopen £¨ £© £¨ºÍÉÐδ¹Ø±Õfclose £¨ £© £© ¡£
³¤¶È
³¤¶ÈµÄÊý¾Ý½øÐмìË÷¡£
allowable_tags
Äú¿ÉÒÔʹÓÿÉÑ¡µÄµÚÈý¸ö²ÎÊýÀ´Ö¸¶¨±êÇ©£¬²»Ó¦¸Ã±»°þ¶á¡£
·µ»ØÖµ
·µ»ØÒ»¸ö×Ö·û´®µÄ³¤¶È×î¶à- 1×Ö½Ú¶ÁÈ¡ÎļþÖ¸³ö£¬Í¨¹ý´¦Àí£¬ËùÓеÄHTMLºÍPHP´úÂëÌõÎÆ¡£
Èç¹û³öÏÖ´íÎó£¬Ôò·µ»ØFALSE ¡£
ÐÞ¸Ä
°æ±¾ËµÃ÷
5.0.0³¤¶È²ÎÊýÊÇ¿ÉÑ¡µÄ
4.0.0ÔÚallowable_tags²ÎÊý²¹³ä˵£¬
$str = <<
Welcome! Today is the of .
$handle = @fopen("sample.php", "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgetss($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>