Skip to content

Instantly share code, notes, and snippets.

@saintbyte saintbyte/1.php
Created Oct 11, 2018

Embed
What would you like to do?
<?php
// THIS FILE is in PUBLIC DOMAIN
//
// Call like this
// http://example.im/111/1.php?start1=1&end1=10&start2=31&end2=40
// http://example.im/111/1.php?start1=11&end1=20&start2=41&end2=50
// http://example.im/111/1.php?start1=21&end1=30&start2=51&end2=60
//
sleep(rand (0, 2.5));
$START1=intval($_GET['start1']);
$END1=intval($_GET['end1']);
$START2=intval($_GET['start2']);
$END2=intval($_GET['end2']);
$arr1 = array();
for($i=$START1; $i <= $END1; $i++ )
{
array_push($arr1,array("id"=>$i, "test"=>"Test ".$i));
}
for($i=$START2; $i <= $END2; $i++ )
{
array_push($arr1,array("id"=>$i, "test"=>"Test ".$i));
}
echo json_encode($arr1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.