Añadir 'public_html/ascii/random.php'

This commit is contained in:
Lucas 2021-04-10 23:03:15 +00:00
parent 2707a15b2a
commit 631c8fbeb0
1 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,5 @@
<?php include "blog_config.php";
$selcted=rand(0,count($posts)-1);
header("Content-type: aplication/json");
if(strpos($posts[$selected][2],"\n")){$ascii=str_replace("\n","\\n",$posts[$selected][2]);}else{$ascii=$posts[$selected][2];}
echo "{'date':'$posts[$selected][0]','title':'$posts[$selected][1]','art':'$ascii'}"; ?>