Skip to content

Instantly share code, notes, and snippets.

@saintbyte
Created October 11, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saintbyte/0971a4e23a1abe962a2981c84d4e8dc3 to your computer and use it in GitHub Desktop.
Save saintbyte/0971a4e23a1abe962a2981c84d4e8dc3 to your computer and use it in GitHub Desktop.
<?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