當前位置:編程學習大全網 - 網站源碼 - php中getcache的使用

php中getcache的使用

PHP的getcache是壹個讀取緩存文件的函數。

例如,通用的當前站點類別保存在緩存文件中,讀取時使用:

$ this-& gt;類別?=?getcache('category_content_ ')。$ this-& gt;siteid,' commons ');具體例子:

& lt?服務器端編程語言(Professional Hypertext Preprocessor的縮寫)

$叠代器?=?新的?ArrayIterator(array(1,2,?3));

$cache=?新的?CachingIterator($iterator,?caching iterator::FULL _ CACHE);

$ cache-& gt;next();

$ cache-& gt;next();

var _ dump($ cache-& gt;get cache());

$ cache-& gt;next();

var _ dump($ cache-& gt;get cache());

& gt

上述例程將輸出:

數組(2) {

?[0]= >

?int(1)

?[1]= >

?int(2)

}

數組(3) {

?[0]= >

?int(1)

?[1]= >

?int(2)

?[2]= >

?int(3)

}

  • 上一篇:小遊戲制作源代碼
  • 下一篇:get請求拿不到完整的網頁源碼
  • copyright 2024編程學習大全網