Re: array manipulations
| From: | Marek Kilimajer | Date: | Tue, 26 Nov 2002 11:12:40 +0000 |
| Subject: | Re: array manipulations | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126069@lists.php.net to get a copy of this message | ||
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 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 tia Mattia