You are here: Re: [PHP] reg ex help « PHP « IT news, forums, messages
Re: [PHP] reg ex help

Posted by conditional motion on 11/04/05 20:42

The problem with that is there are about 40 different listings in the
one field.

Silver Small Corp;;;;;X^%%%%%\n#####\n
Gold Medium Corp;;;;;RE^%%%%%\n#####\n
Platinum Large Corp;;;;;YRE^%%%%%\n#####\n

being three of them so maybe this is a bettter way of listing it

.... Silver Small Corp;;;;;X^%%%%%\n#####\nGold Medium
Corp;;;;;RE^%%%%%\n#####\nPlatinum Large Corp;;;;;YRE^%%%%%\n#####\n
....

On 11/4/05, Jay Blanchard <jay.blanchard@thermon.com> wrote:
> [snip]
> New to php so please bear with me. I'm trying to parse through a
> field that has some information in it, the information is stored with
> other information and is delimited in a certain pattern so I figure
> using reg ex I can get the information I want out of the text.
>
> So here is an example.
>
> Silver Small Corp;;;;;X^%%%%%\n#####\n
> Gold Medium Corp;;;;;RE^%%%%%\n#####\n
> Platinum Large Corp;;;;;YRE^%%%%%\n#####\n
>
> Reall all I need is the information on Silver Small Corp, etc and the
> X all the rest is gibberish. Is Reg Ex the best way to do this or
> would it be some other way.
> [/snip]
>
> You couuld use explode
>
> $myField = "Silver Small Corp;;;;;X^%%%%%\n#####\n";
>
> $foo = explode(";;;;;", $myField);
>
> echo $foo[0];
>

 

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

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