I have this array
array(6) {
[0]=>
string(7) "1234567"
[1]=>
string(5) "7548#"
[2]=>
string(9) "1254#abc#"
[3]=>
string(5) "32514"
[4]=>
string(6) "2548##"
[5]=>
string(5) "3258#"
}
I want to validate this data based on provided condition.
If ID(array[0] and array[3] or array[n]) is an integer check the *data* which is(array[1] and array[4] or array[n]) and if that data not contain more then one #, return false;
here is my sample code, but I'm only able to check the first and 2nd array,
if(preg_match('/^[1-7]{1,7}$/', current($arr))){
next($arr);
if(substr_count(next($arr),"#") <=1)
//false
else
echo "true";
}
help needed, thanks.