Don't take it all for granted when you want to give tens of thousands of hundreds stadiums users a message to show.
Would you go to the table of information in the database to insert a message to all users?
I think most people don't do that, but sometimes they take it for granted, and that's the way it's done. 20 of them must have done the same.
This is a mistake. A change of mind, to a person is certainly only to 20 users of one of the people only let him see, so we in the library to give him a message, show him to see himself.
For everyone to see the common information, there is no distinction between, then we can generate a cache file, the content to be displayed in the header of the file contains, read static information. You can set the display time in the display, so that you can do not show the expiration.
These are some of the thoughts I learned today, and I think most people are smarter than me.
Here is an example showing:
$arr is the message you're going to show here is an array var_export we all know what to do, not much to do with the narrative.
Because of the PHP file generated, our <?php?> (recommended long mark) is essential.
$array = "<?php\r\nreturn". Var_export ($arr, true). "; R\n?> ";
$path is the address that the cache file is stored in. $file is the file name
$path = $path. $file. " PHP ';
File_put_contents () generates a cache file.
File_put_contents ($path, $array);
It is a good way to get familiar with the business and to improve the logic of thinking by looking at more programs and practicing and optimizing them.
2014-11-18
From Baidu Space Transfer original 1
Make reasonable use of cached files