Php: how to process files and extract content to generate files-php Tutorial

Source: Internet
Author: User
How does php process files and extract content to generate files? This is an original html file & lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; XHTML & nbsp; 1.0 & nbsp; TransitionalEN & nbsp; www. how does w3.orgTRxhtml1DTDxhtml1-t php process files and extract content to generate files?
This is an original html file.






Untitled Document





















This is a processed html file.








Untitled Document





























Then extract the content fragments and generate the following three files,


Extract this part to generate head.html






Untitled Document








Extract this part to generate index.html

















Extract this part to generate foot.html







Php file generation? Php

Share:


------ Solution --------------------
$ S = <HTML





Untitled Document

























HTML;
Preg_match_all ('/.*? /Is ', $ s, $ r );
Print_r ($ r [0]);
Get
Array
(
[0] =>




Untitled Document




[1] =>











Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.