apc_exists

(PECL apc >= 3.1.4)

apc_exists锟斤拷锟紸PC锟斤拷锟角凤拷锟斤拷锟侥筹拷锟斤拷锟斤拷锟侥承﹌ey

说锟斤拷

apc_exists ( mixed $keys ) : mixed

锟斤拷锟斤拷欠锟斤拷锟揭伙拷锟斤拷锟斤拷叨锟斤拷APC锟斤拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷

keys

string锟斤拷锟斤拷锟竭帮拷锟斤拷锟斤拷锟斤拷 array锟斤拷元锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟終ey锟斤拷锟节的伙拷锟斤拷锟斤拷 TRUE , 锟斤拷锟津返伙拷 FALSE 锟斤拷锟斤拷锟斤拷锟� keys锟斤拷一锟斤拷array 锟斤拷 锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟叫达拷锟节碉拷key锟斤拷锟斤拷锟介,锟斤拷锟斤拷锟斤拷锟斤拷锟叫碉拷key一锟斤拷锟斤拷锟斤拷锟斤拷锟节的伙拷锟斤拷 锟酵凤拷锟截空碉拷锟斤拷锟介。

锟斤拷锟斤拷

Example #1 apc_exists() 锟斤拷锟斤拷

<?php
$fruit  
'apple';
$veggie 'carrot';

apc_store('foo'$fruit);
apc_store('bar'$veggie);

if (
apc_exists('foo')) {
    echo 
"Foo exists: ";
    echo 
apc_fetch('foo');
} else {
    echo 
"Foo does not exist";
}

echo 
PHP_EOL;
if (
apc_exists('baz')) {
    echo 
"Baz exists.";
} else {
    echo 
"Baz does not exist";
}

echo 
PHP_EOL;

$ret apc_exists(array('foo''donotexist''bar'));
var_dump($ret);

?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

Foo exists: apple
Baz does not exist
array(2) {
  ["foo"]=>
  bool(true)
  ["bar"]=>
  bool(true)
}

锟轿硷拷

  • apc_cache_info() - Retrieves cached information from APC's data store
  • apc_fetch() - 锟接伙拷锟斤拷锟斤拷取锟斤拷锟芥储锟侥憋拷锟斤拷