I have a two dimensional array that contain range of numbers that have to be validated using following rules, range should start from 0 and follow in arithmetic progression.
For example:
$array = array();
$array[] = array(0);//VALID
$array[] = array(0,1,2,3,4,5);//VALID
$array[] = array("0","1");//VALID
$array[] = array(0,1,3,4,5,6);//WRONG
$array[] = array(1,2,3,4,5);//WRONG
$array[] = array(0,0,1,2,3,4);//WRONG
what is most efficient way to do that in php?
UPDATE
I forgot to add that numbers can be represented as string