The file path has been saved in the database table. How can I output the file name from the database on the page and click on the file name to view the file content?
生如夏花
生如夏花 2019-04-24 11:15:13
0
3
1258

I am doing a file upload and output. Now the file upload has been implemented, but I don’t know how to output the output. The path of the file has been reserved in the database. I want to output the file name on the page, and then click on the file name to view the entire content of the file. How to achieve this?

生如夏花
生如夏花

reply all(2)
瓢老师

Garbled characters are generally caused by encoding problems. You must first determine the encoding of the file you read, and then convert it

$str = file_get_contents("./1.txt");
$encod = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
$str = iconv($encod ,'UTF-8' ,$str);
echo $str;


瓢老师

file_get_contents(filename)

试试

  • reply When file_get_contents(filename) is opened, garbled characters appear. How to solve it?
    生如夏花 author 2019-04-24 15:30:50
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template