php 写字符串到文件中
<?
function write_to_file($fn, $str)
{
if ($str == '') return 'Nothing to write...';
if ($fn == '') return 'No file to write to...';
if (($fp = @fopen($fn, 'w')) === false) return 'Error obtaining file handle';
if (@fwrite($fp, $str, strlen($str)) === false)
{
fclose($fp);
return 'Error writing to file';
}
fclose($fp);
return 'Data written to file successfully';
}
?>
以上就是PHP 写字符串到文件中的内容,更多相关内容请关注PHP中文网(www.php.cn)!
C编写,实现字符串摘要、文件摘要两个功能。里面主要包含3个文件: Md5.cpp、Md5.h、Main.cpp。其中Md5.cpp是算法的代码,里的代码大多是从 rfc-1321 里copy过来的;Main.cpp是主程序。
0
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号