what is wrong with that?
Posted: Tue Sep 09, 2003 3:28 am
Hello all,
I'm trying to read an array and my purpose is whenever I see a value which is all ***** (between 30-100) I want to do store this value.
here is what I got:
function isStar($string)
{
if(preg_match("/^\*{30,100}\*$/",$string))
return true;
else
return false;
}
for ($i=0;$i<count($allArr);$i++)
{
$aLine=$allArr[$i];
if(isStar($aLine))
{
if(isStar( $allArr[$i+1]) || isStar($allArr[$i+2])) || isStar($allArr[$i+3])) )
/*do something*/
}
}
it keeps getting false answeres and never true though it should!
any ideas?
thanks
I'm trying to read an array and my purpose is whenever I see a value which is all ***** (between 30-100) I want to do store this value.
here is what I got:
function isStar($string)
{
if(preg_match("/^\*{30,100}\*$/",$string))
return true;
else
return false;
}
for ($i=0;$i<count($allArr);$i++)
{
$aLine=$allArr[$i];
if(isStar($aLine))
{
if(isStar( $allArr[$i+1]) || isStar($allArr[$i+2])) || isStar($allArr[$i+3])) )
/*do something*/
}
}
it keeps getting false answeres and never true though it should!
any ideas?
thanks