PHP ย้อนกลับ () ฟังก์ชัน
ความหมายและการใช้งาน
ย้อนกลับ () ฟังก์ชัน rewinds จุดเริ่มต้นที่ตำแหน่งแฟ้มชี้ของไฟล์
หากประสบความสำเร็จการทำงานผลตอบแทนจริง หากล้มเหลวก็จะส่งกลับ FALSE
ไวยากรณ์
rewind(file)
参数 | 描述 |
---|---|
file | 必需。规定已打开的文件。 |
ตัวอย่าง
<?php
$file = fopen("test.txt","r");
//Change position of file pointer
fseek($file,"15");
//Set file pointer to 0
rewind($file);
fclose($file);
?>
$file = fopen("test.txt","r");
//Change position of file pointer
fseek($file,"15");
//Set file pointer to 0
rewind($file);
fclose($file);
?>
เสร็จสมบูรณ์คู่มือการใช้งานระบบแฟ้ม PHP อ้างอิง