PHP rewinddir()函式與示例

2021-10-08 20:39:45 字數 1200 閱讀 4950

rewinddir() functionis used to rewind/reset the directory handle which is created by the opendir() function.

rewinddir()函式用於後退/重置由opendir()函式建立的目錄控制代碼。

syntax:

句法:

rewinddir(dir_handle);
parameter(s):

引數:

return value:

返回值:

it returns nothing.

它什麼也不返回。

example: php code to demonstrate example of rewinddir() function

示例:php**演示rewinddir()函式的示例

<?php

$path = "/home";

//checking whether $path is a directory or not

//then, opening the directory and reading its files

if (is_dir($path))

//rewinding/reset the directory handle

rewinddir();

//reading the files again

while (($file = readdir($dh)) !== false)

//closing the directory

closedir($dh);

}}?>

output

輸出量

file:.

file:..

file:main.php

file:.

file:..

file:main.php

reference: php rewinddir() function

參考: php rewinddir()函式

翻譯自:

函式指標 與 函式

c primer 7.10函式指標 241頁 通常,要宣告指向特定型別的函式的指標,可以首先編寫這種函式的原型,然後用 pf 替換函式名。這樣pf就是這類函式的指標。如 double pam int double pf int 用指標來呼叫被指向的函式。線索來自指標宣告。pf 扮演的角色與函式名相同...

類函式與函式

類函式,可以記錄某些東西,可以作為物件進行返回。而函式無法記錄。類函式很神奇,是類的同時,也可以當函式使用,其好處在於可以記錄某些東西,方便呼叫 而函式不能用於呼叫。因此這就是類函式的好處。map的用法,鍵值對。multimap不支援按鍵值操作,map是支援的。expilcit關鍵字的主要作用是用來...

函式與建構函式

建立乙個物件的方式中有乙個建構函式模式。ecmascript中的建構函式是用於建立特定型別物件的。如object和array這樣的原生建構函式,執行時可以直接在執行環境中使用。還可以自定義建構函式,以函式的形式為自己的物件型別定義屬性和方法 如乙個建構函式 function student name...