A php program that can search for news in the local database and add news and word library operations

Source: Internet
Author: User

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 


<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 


<? Php function setHtml ($ file, $ news, $ title, $ time) {if (! File_exists ($ file) {$ str = file_get_contents ("file: // C:/news/test/apache2_2/htdocs/6/model.htm"); // template file, required file_put_contents ($ file, $ str) ;}$ p = fopen ($ file, "r +"); if (! Is_writeable ($ file) {echo "It is not writable"; return ;}$ string = ""; $ string = file_get_contents ($ file ); $ replacements [0] = "<title> $ title </title>"; $ replacements [1] = "<p> $ news </p> "; $ replacements [2] = "<p> $ title </p>"; $ replacements [3] = "$ time "; $ patterns [0] = "/<title> ((. * \ n) * | (. * \ n )). * <\/title>/"; $ patterns [1] ="/<p>. * <\/p>/"; $ patterns [2] ="/


<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 

In fact, the calling process of these files should be clarified first. The so-called framework code writing is the simplest, but I am still too low-level! I have not yet understood how to use a framework to write code. I think it will be much better to write an outline first, just like writing an essay, it is best to clarify the structure of each part and the role of each file.

Related Article

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.