file_get_contents_try()

file_get_contents_try()

file_get_contents_try($file, $times = 3)

【功能】

获取文件的内容,在并发的环境中容易读取失败,会自动重试。

【参数】

$file:文件路径
$times:重试次数

【用例】

<?php

include "./xiunophp/xiunophp.php";

$s = file_get_contents_try("1.txt");

echo $s;

?>
文章导航