Ver original$links = [ 0 => 'http://google.com', 1 => 'http://yahoo.com', // etc.]; $id = (int) $_GET['id']; echo $links[$id];