Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to read and output other files by php

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces php how to read and output other files, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Ob_start ()

Iconv ('utf-8','gb2312',readfile (' 1.html')); / / output text content directly

Echo''

$data = file_get_contents ('. / 1. HtmlLighting nullReagennullrecovernullRegent 0pc10)

Var_dump ($data); / / output string

Echo''

$data = file ('. / 1.html')

Var_dump ($data); / / output array

Echo''

$stream = fopen ('. / 1.html)

Echo stream_get_contents ($stream,12); / / output string

Echo''

/ / fread () reads files (which can be safely used for binary files) file system pointers, which are typically resource (resources) created by fopen ().

$data = fopen ('. / 1.html)

$contents = fread ($data,filesize ('. / 1.html'))

Echo $contents;// output string

Thank you for reading this article carefully. I hope the article "how to read and output other documents in php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report