if all you might have there is 'error', try
if(array_search('error',$array) === FALSE) {
echo 'not ok';
}
if you might have different strings, do
$result='ok';
foreach($array as $v) {
if($v) {
$result ='not ok';
break;
}
}
Mattia wrote:
Can anyone suggest an ELEGANT way t
Mattia,
> Can anyone suggest an ELEGANT way to find out if an array is made of empty
> strings or not?
> example
> $a = Array( '' , '' , '' ); //ok
> $b = Array( '' , '' , 'error' ); // not ok
> $c = Array( 'error' , '' , 'error' ); // not ok
implode() then check for nullstring/count characters.
2 matches
Mail list logo