This commit is contained in:
Kasper Rynning-Tønnesen
2014-08-08 17:57:57 +02:00
parent b610406d5a
commit 5b02294f38
4 changed files with 165 additions and 162 deletions

View File

@@ -1,20 +1,20 @@
<?php
if(isset($_POST['thisUrl']))
{
$string = $_POST['thisUrl'];
$file = file_get_contents('videos.json');
$data = json_decode($file);
unset($file);//prevent memory leaks for large json.
//insert data here
if($data[0] == $string)
{
array_shift($data);
}
file_put_contents("videos.json", json_encode($data));
unset($data);
}else
{
echo "You're a bad boy";
}
<?php
if(isset($_POST['thisUrl']))
{
$string = $_POST['thisUrl'];
$file = file_get_contents('videos.json');
$data = json_decode($file);
unset($file);//prevent memory leaks for large json.
//insert data here
if($data[0] == $string)
{
array_shift($data);
}
file_put_contents("videos.json", json_encode($data));
unset($data);
}else
{
echo "You're a bad boy";
}
?>