摘要:
1 /** 2 * 其它版本 3 * 使用方法: 4 * $post_string = "app=request&version=beta"; 5 * request_by_other('http://facebook.cn/restServer.php',$post_string); 6 */ 7 function request_by_other($remote_server,$post_string){ 8 $context = array( 9 'http'=>array( 10 'method'... 阅读全文
posted @ 2012-09-12 13:30
简单--生活
阅读(235)
评论(0)
推荐(0)
摘要:
判断文件存在用is_file还是file_exists?在写程序时发现在判断文件是否存在时,有两种写法,有的人用了is_file,有的人用了file_exists,用哪个更好或者说更合适呢?看了这篇PHP中file_exists与is_file,is_dir的区别的说法基本明白,PHP的 file_exists = is_dir + is_file。写程序验证一下:分别执行1000次,记录所需时间。文件存在(当前目录)is_file:0.4570msfile_exists:2.0640ms文件存在(绝对路径3层/www/hx/a/)is_file:0.4909msfile_exists:3.3 阅读全文
posted @ 2012-09-12 13:26
简单--生活
阅读(374)
评论(0)
推荐(0)