<! 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.