note 31639 deleted from function.array-push by irchtml
| From: | irchtml@php.net | Date: | Tue, 24 Feb 2004 08:59:47 +0000 |
| Subject: | note 31639 deleted from function.array-push by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65635@lists.php.net to get a copy of this message | ||
Note Submitter: t0rus@dr.com
----
//fixed up that function a bit
function validate ($string){
$Stack=array("");
array_pop($Stack);
$i=0;
while ($i<=strlen($string)){
$ft=substr($string,$i,1);
if ($ft=="(")
array_push($Stack,$ft);
elseif ($ft==")")
array_pop($Stack);
$i++;
}
return sizeof($Stack)==0;
}