1. Go to this page and download the library: Download gokhankurtulus/jsoncache library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$data = $jsonCache->get('my_key');
if ($data !== null) {
// Use the cached data
echo $data['name']; // John Doe
echo $data['age']; // 30
} else {
// Data not found or expired
}
if ($jsonCache->has('my_key')) {
// Key exists in the cache
} else {
// Key does not exist
}
$jsonCache->delete('my_key');
$jsonCache->clear();
$jsonCache->getCacheSize('my_key'); // Returns the size of the key in bytes
$jsonCache->getLifetime(); // Returns cache instance lifetime
$jsonCache->setLifetime(120); // Sets cache instance lifetime to 120 seconds
$jsonCache->isCompressed(); // Returns cache compress status
$jsonCache->getConfig(); // Returns config array
$jsonCache->getStoragePath(); // Returns config's storage path
$jsonCache->getIndexFile(); // Returns config's index file path
$jsonCache->getJsonFlags(); // Returns config's json flags
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.