Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function bacaHTML($url){
- ...........
- }
- function getFromCache($url){
- if (!file_exists("wincache")) {
- mkdir("wincache");
- }
- $cache_file = "wincache/_jadwal.txt";
- // cache for 61 minutes
- $file = "";
- if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 60 * 61 ))) {
- $file = file_get_contents($cache_file);
- }
- else{
- $file = bacaHTML($url);
- file_put_contents($cache_file, $file, LOCK_EX);
- }
- return $file;
- }
- $kodeHTML = getFromCache('http://................');
- ............
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement