Server-Side Scripting/Key-Value Databases/PHP

index.php
";   return $result; }

function country_exists($country) { $redis = new Redis; $redis->connect($GLOBALS["HOST"]); $result = $redis->exists($country); return !!$result; }

function insert_country($country, $temperature) { $redis = new Redis; $redis->connect($GLOBALS["HOST"]); $redis->set($country, $temperature); }

function update_country($country, $temperature) { $redis = new Redis; $redis->connect($GLOBALS["HOST"]); $redis->set($country, $temperature); }

function delete_country($country) { $redis = new Redis; $redis->connect($GLOBALS["HOST"]); $redis->del($country); }

?>

Try It

 * 1) Use Docker/Redis to run a Redis server.
 * 2) Use Docker/PHP and copy and paste the code above to run as the PHP application. Be sure to modify the Redis host address to match the address received by your Redis server.