This question already has an answer here:
How to check that php explode hold only comma separated integer values.
for example i have a
$str= '10,20,30,40,50,60,70,80,90,100';
$arr = explode(',',$str);
and i want to check if the value in $str is 10,20,30 and so on. and cannot contain any of string and words.
I basically populate a drop-down from this $arr and i want to make check if user enter integer values with comma then its show the dropdown else if user enter any other format.
i also use is_int
or is_numeric
but it cannot solve my problem.
thanks for advance .
</div>