PHP Knowledge 8

文件属性:

文件所有者:      fileowner(文件名)

文件大小(Byte) filesize(文件名)

文件类型:        filetype(文件名)

File information functions

Function name

What file information does the function provide?

file_exists( )

Does the file exist?

fileatime( )

Last access time

filectime( )

Last metadata change time

filegroup( )

Group (numeric)

fileinode( )

Inode number

filemtime( )

Last change time of contents

fileowner( )

Owner (numeric)

fileperms( )

Permissions (decimal, numeric)

filesize( )

Size

filetype( )

Type (fifo, char, dir, block, link, file, unknown)

is_dir( )

Is it a directory?

is_executable( )

Is it executable?

is_file( )

Is it a regular file?

is_link( )

Is it a symbolic link?

is_readable( )

Is it readable?

is_writable( )

Is it writeable?

――――――――――――――――――――――――――――――――――――

文件本身就是一个数组

$myFile = file("data.txt");

通过file()函数将文件转换为一个字符串数组

<HTML>

<HEAD>

<TITLE>调用文本文件内容</TITLE>

</HEAD>

<BODY>

<CENTER>

<?

        // 打开文件同时,打印每一行

        $myFile = file( "data.txt");

//得到字符串数组,每一行为数组的一个元素

        for($index = 0; $index < count($myFile); $index++)

        {

                print($myFile[$index]."<BR>");

        }

?>

</CENTER>

</BODY>

</HTML>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值