You are here: Re: [PHP] Seemingly weird regex problem « PHP « IT news, forums, messages
Re: [PHP] Seemingly weird regex problem

Posted by Jason Wong on 01/20/05 20:41

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация