console.log("in save.php"); if($data[0] == $string) { array_push($data, $string); array_shift($data); } file_put_contents("videos.json", json_encode($data)); unset($data); }else { echo "You're a bad boy"; } ?>