forked from liukuan/memcache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
44 lines (34 loc) · 1.19 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
include 'mcache.php';
//get content
if(!$content = mcache::getInstance()->getFacebook()){
$data = file_get_contents('http://www.facebook.com/');
//set content
mcache::getInstance()->setFacebook($data);//->getFacebook();
echo mcache::getInstance()->getFacebook();
}else echo $content;
//replace
mcache::getInstance()->repFacebook($data_str);
//delete
mcache::getInstance()->delFacebook();
//Settings page content
$data = file_get_contents('http://www.facebook.com/?page=1');
mcache::getInstance()->setFacebook($data,1);
//page 1 content
echo mcache::getInstance()->getFacebook(1);
//replace
mcache::getInstance()->repFacebook($replace_str,1);
//delete
mcache::getInstance()->delFacebook(1);
echo mcache::getInstance()->getFacebook(1);
$google = file_get_contents('http://www.google.com/');
echo mcache::getInstance()->setGoogle($google)->getGoogle();
//Num++
echo mcache::getInstance()->incNum();
//Num--
echo mcache::getInstance()->decNum();
echo mcache::getInstance()->getNum();
//int++ Starting from 100
echo mcache::getInstance()->incInt(100);
//int-- Starting from 100
echo mcache::getInstance()->decInt(100);