php怎么将源码变成html内容

2025-05-12 15:57:34
推荐回答(2个)
回答(1):


header("Content-Type: text/html; charset=utf-8");

$file_path="checkPhoto.php";

$fp = fopen($file_path,"r");
$str ="";
while(!feof($fp)){
$str .= fgets($fp);//逐行读取。如果fgets不写length参数,默认是读取1k。
}
$str = str_replace("\r\n","",$str);
echo $str;

?>

回答(2):

这个不好弄