The first is a set of code:
Abstract class user {} class admin extends user {private $ group; public static function create () {return new admin ();} public static function getgroup () {return "admin ";}//....... other functions ..}
Class
I. php scripts and dynamic pages.
A PHP script is a server-side scripting program that can be mixed with HTML files by embedding methods, classes, function encapsulation, and other forms to process user requests in a template. Regardless of the
Ec (2); below are some of the program records in Pixy, mainly to be able to quickly understand program ideas and record them, otherwise, how can we do so many things on our minds. In some cases, it may be difficult for me to look at it.
Ec (2); & nbsp; Continue with yesterday's topic, this time I am still working to understand the php parsing process. This shows the ParseTree generated by parsing the PHP file in ProgramConverter, and uses JTree. & Nbsp; of course,
Ec (2); & lt ;? Phpdate_default_timezone_set (& quot; AsiaShanghai & quot;); classTCreateHTML {var $ HTemplate; Template File var $ FileName; new file name var $ HTFilePath; Path of the generated file var $ ModiString; var $ ReText script ec (2);
Static PHP pages .? Objects) 60*3) {return the static file content to the client $ start_timemi
// First view the cached file if (file_exists ("static.html") {// The cache time is 3 minutes if (time ()-filemtime ("static.html") "; Echo
Hegel has a famous saying: existence is reasonable. With this as an argument, the use of static classes must have its rationality. But extremes meet, once the code is too dependent on static classes, its deterioration of the outcome is inevitable.
Static call non-static Method!! This is unthinkable in the java,c#, and absolutely not. Such errors are indicated incorrectly in these languages during the compilation phase. But what about dynamic languages like PHP? First of all, this is a grammar
When some tickets are worth it, we often write this way to call a method.$ A = A: getInstance ();$ A-> setCount (10 );$ A-> showCount ();We can change setCount to a static method.Put A: getInstance () in this methodWe can write it like this.A:
Static variables only exist in the function scope. That is to say, static variables only exist in the stack. Generally, variables in a function are released after the function ends, such as local variables, but static variables do not. That is to
I. PHP scripts and dynamic pages.
A PHP script is a server-side scripting program that can be mixed with HTML files by embedding methods, classes, function encapsulation, and other forms to process user requests in a template. Regardless of the
First, let's talk about the principle. A certain camel checked so much information and found that no matter what method is used, the principle is the same. It is to use the program to read the corresponding data to replace the variables in the
I don't like Smarty. I directly wrote a static class, which is convenient, simple, and practical. I hope you can continue to improve it.
The code is as follows:
/*********************/
/**/
/* Version: 5.2.5 */
/* Author: liqiangwork # sohu.com */
/
PHP generates static html files. Php is used to generate static files. most of the files are generated by replacing them with templates. for example, if I define {A} as A tag in php, I only need to use fopen to read the template file, then, repla
Many php developers know that the efficiency of using static member functions of classes is higher than that of common member functions of classes. This article analyzes this problem at the application level, many php developers know that the
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.