In this tutorial you will learn how to check and delete cache values in PHP APC. I will explain how to use PHP functions apc_exists and apc_delete.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# PHP APC Check and delete cache values # PHP scripts used apc_exists.php apc_delete.php apc_store.php apc_fetch.php Useful links: http://php.net/manual/en/function.apc-exists.php http://php.net/manual/en/function.apc-delete.php http://php.net/manual/en/function.apc-store.php http://php.net/manual/en/function.apc-fetch.php |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php /** * apc_exists * Checks if APC key exists * http://php.net/manual/en/function.apc-exists.php */ var_dump(apc_exists('CUR_DATE_0s_1')); var_dump(apc_exists('CUR_DATE_0s_1_NOT_FOUND')); var_dump(apc_exists(array( 'CUR_DATE_0s_1', 'CUR_DATE_0s_1_NOT_FOUND', ))); ?> |
1 2 3 4 5 6 7 8 |
<?php /** * apc_delete * Removes a stored variable from the cache * http://php.net/manual/en/function.apc-delete.php */ apc_delete('CUR_DATE_0s_1'); ?> |
For apc_store.php and apc_fetch.php files checkout PHP APC Set and get cache values tutorial.
Useful links:
http://php.net/manual/en/function.apc-exists.php
http://php.net/manual/en/function.apc-delete.php
http://php.net/manual/en/function.apc-store.php
http://php.net/manual/en/function.apc-fetch.php
https://www.liviubalan.com/php-apc-set-and-get-cache-values