Re: Seemingly weird regex problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 21 January 2005 01:52, Tim Boring wrote:

> To try to help spot the issue, I put in the if(preg_match("/^\W+/",
> $line)) logic, and the weird thing is that this logic isn't outputting
> the line beginning with things like "AKRN", yet the same line is getting
> caught in the switch statement and being discarded.

Well the biggest problem in your code right now is your incomprehensible (to 
me anyway) use of the switch construct. For a start I've no idea why you're 
using ...

>     switch ($line)

... when your tests do not involve $line

>         case ($total_counter <= 5):

I suspect what you want to be doing is something like this:

  switch (TRUE) {
    case ANY_EXPRESSION_THAT_EVALUATES_TO_TRUE:
    ...
  }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux