mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-23 04:18:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@299728 c90b9560-bf6c-de11-be94-00142212c4b1
125 lines
2.6 KiB
XML
125 lines
2.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="function.apc-exists" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>apc_exists</refname>
|
|
<refpurpose>Checks if APC key exists</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>apc_exists</methodname>
|
|
<methodparam><type>mixed</type><parameter>keys</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Checks if one ore more APC keys exist.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>keys</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A <type>string</type>, or an <type>array</type> of strings, that
|
|
contain keys.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns &true; if the key exists, otherwise &false; Or if an
|
|
<type>array</type> was passed to <parameter>keys</parameter>, then
|
|
an array is returned that contains all existing keys, or an empty
|
|
array if none exist.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title><function>apc_exists</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?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);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Foo exists: apple
|
|
Baz does not exist
|
|
array(2) {
|
|
["foo"]=>
|
|
bool(true)
|
|
["bar"]=>
|
|
bool(true)
|
|
}
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>apc_cache_info</function></member>
|
|
<member><function>apc_fetch</function></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|