caneslarry/php-helpers

Useful functions for PHP development.

0.0.1 2024-02-22 21:31 UTC

This package is auto-updated.

Last update: 2024-09-22 23:03:10 UTC


README

`

// Example usage:
$cache = new Cache();

$cache->set('example_key', 'example_value', 10);

$value = $cache->get('example_key');
if ($value !== null) {
    echo "Value from cache: $value\n";
} else {
    echo "Value not found in cache.\n";
}

sleep(15);

$value = $cache->get('example_key');
if ($value !== null) {
    echo "Value from cache: $value\n";
} else {
    echo "Value not found in cache after TTL expiry.\n";
}

`