PHP fgetss()ฟังก์ชัน
❮ การอ้างอิงระบบไฟล์ PHPตัวอย่าง
อ่านหนึ่งบรรทัดจากไฟล์ HTML ที่เปิดอยู่ (แถบแท็ก):
<?php
$file = fopen("test.htm","r");
echo fgetss($file);
fclose($file);
?>
ความหมายและการใช้งาน
ฟังก์ชัน fgetss() ส่งคืนบรรทัดจากไฟล์ที่เปิดอยู่ โดยแยกจากแท็ก HTML และ PHP
หมายเหตุ:ฟังก์ชัน fgetss() เลิกใช้แล้วจาก PHP 7.3
ไวยากรณ์
fgetss(file, length, tags)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
file | Required. Specifies the open file to return a line from |
length | Optional. Specifies the number of bytes to read. Reading stops when length-1 bytes have been reached, or a when a new line occurs, or on EOF. Note: This parameter is required in versions prior to PHP 5 |
tags | Optional. Specifies which tags that will not be removed |
รายละเอียดทางเทคนิค
คืนมูลค่า: | อ่านบรรทัดเดียวจากไฟล์ว่าสำเร็จ FALSE บน EOF หรือข้อผิดพลาด |
---|---|
รุ่น PHP: | 4.0+ |
❮ การอ้างอิงระบบไฟล์ PHP