php获取某个目录下面文件的内容

if(!defined('PATH'))
define('PATH', dirname(dirname(__FILE__)).'/');
ini_set ( 'include_path', '.:' . PATH );//.:是linux,.;是windows
$file = PATH.'/http/getbaiwu/1';
$handle = fopen(PATH.'/http/getbaiwu/1','r');
$filecontent = fread($handle,filesize($file));
$res = ((array)$filecontent);
print_r($res);

 

你可能感兴趣的:(PHP)