Finding minimum array integer
You should indent your code properly to make it more readable.



Posting PHP on JSFiddle is apocalyptic insanity a bad idea. JSFiddle is for JavaScript.
Use IDEOne for PHP Instead.



Your use of whitespace could be improved.


 for ($z=0;$z&lt;$firstrow2;$z++)



into: for ($z = 0; $z &lt; $firstrow2; $z++)



Your variable naming is shortened, sometimes confusing, and flat out bad practice in places.
Transform them from lowercase to camelCase.



You don't even use $firstrow1, remove it.



$getRagearr sounds like a pirate themed narcotic. Perhaps $getRangeArray would be much clearer.



$j=intval($getRagearr[1]): what's wrong with good ole' fashioned int()?'



This is the result of all my suggestions:

$handle = fopen("php://stdin", "r");
$getFirstRow = fgets($handle);
$firstRowArray = explode(" ", $getFirstRow);
$numOfTestCases = int($firstRow[1]);

$getString = fgets($handle);
for ($i = 0; $i &lt; $numOfTestCases; $i++) {
    $getRange = fgets($handle);
    $getRangeArray = explode(" ", $getRange);
    $arrayWidth = int($getRangeArray[0]);
    $arrayLength = int($getRangeArray[1]);
    $arrayResult = array();
    $lane = explode(" ", $getString);
    for ($currentPos = $arrayWidth; $currentPos &lt;= $arrayLength; $currentPos++) {
        array_push($arrayResult, $lane[$currentPos]);
    }
    $result = min($arrayResult);
    echo $result.PHP_EOL;
}




Other than that, your code looks well-structured.