= strval($jsonD["max"])){ array_pop($jsonD["msg"]); } $finalmsg = array("cont"=>$_POST["msg"],"time"=>time(),"type"=>"message","color"=>"red","visibility"=>"dall","from"=>$_POST["usr"]); array_unshift($jsonD["msg"], $finalmsg); $jsonString = json_encode($jsonD); file_put_contents("data/".$_POST["room"].".json",$jsonString); } else { echo "tunnel.roomnotexistorhooknotexist"; } } else { echo "tunnel.security.invalidkey"; } }