This post is mainly for all the phpers to their own in the development or learning of some of the experience and skills to summarize, mainly to solve a certain kind of thing better way to tell everyone.
I'll say a few first:
1, if you use echo to output a simple statement, similar to:
Copy the Code code as follows:
echo "Hello world!";
?>
Then you can slack off and write this:
2,str_replace () can be replaced with an array, such as:
Copy the Code code as follows:
$string = "Welcome to the phpchina.com, with A good time.";
$search = Array ("Welcome to the Phpchina.com", "has A good Time", ".");
$replace = Array ("PHP is very good", "I like It", "!");
$newstring = Str_replace ($search, $replace, $string);
echo $string. "
";
Echo $newstring;
?>
You don't have to hide your experience. Oh, ^_^!
How small is the skill?
I remember the function that sent this cache variable the cache directory is required to have read and write permissions for the caches. There is also a function to refresh the timer before writing it out otherwise it would appear that this technique is too large in fact and DZ's refresh mode is more like
Copy the Code code as follows:
function Getquerycache ($key) {
$cacFile = "cache/". $key. ". PHP";
if (file_exists ($cacFile)) {
@include ($cacFile);
return $cacValue;
}
return false;
}
function Setquerycache ($key, & $result) {
$cacFile = "cache/". $key. ". PHP";
$fp = fopen ($cacFile, "w");
if (false! = $fp) {
Fwrite ($fp, " ");
Fclose ($FP);
return true;
}
return false;
}
The above describes the powerpoint2003 official download free full version of the PHP tips collection, each phper to show off, including the powerpoint2003 official download free full version of the content, I hope that the PHP tutorial interested in a friend helpful.