开发者

How could i Print a block of text in PHP

开发者 https://www.devze.com 2023-03-17 07:17 出处:网络
I have a HTML file which 开发者_如何学Gocontains a table. Using the \"file_get_content()\" i am reading the file then. when i print the content of the HTML file the \"\" tags getting printed in the ne

I have a HTML file which 开发者_如何学Gocontains a table. Using the "file_get_content()" i am reading the file then. when i print the content of the HTML file the "" tags getting printed in the new dynamic page .But i want to print the table only in the webpage. How could i do this


I presume you mean printing like with a browser.

But PHP runs on the server, so printing is not an option.


Assuming that you mean "Put into the output" by "print" (your question's somewhat ambiguous here), echo the result of the file_get_contents call.

Or just use readfile.

If you just want a particular part of a HTML file (a table contained in the markup) then use the domdocument extension to extract the element from the document and output that instead.

If you mean "send to the printer", then you can't do that from PHP.

0

精彩评论

暂无评论...
验证码 换一张
取 消