$url, "short"=>$short);
if (count($data) >= MAX_SAVED_URLS)
{
// Delete the first element
sort_array($data, 'timestamp');
array_shift($data);
}
// Store short link in the data array
$data[$short] = array('timestamp'=>time(), 'url'=>$url);
// Save it in the file
file_put_contents(DATA_FILE, gzdeflate(serialize($data)));
// Echoes the result
$new_url = BASE_URL.'/?'.$short;
?>