You are here: Re: preg_match_all - help « All PHP « IT news, forums, messages
Re: preg_match_all - help

Posted by Gernot Frisch on 09/28/64 11:48

> Hmmz, I almost suspect it has something to do with how he posts.
> I'm
> assuming that the n's are supposed to be \n's... Probably it should
> read:
> '/\d+\)\s(.+)\s:\s(.+)/', which would be somewhat workable.

The website I got it from had this problem :(

> In that case this can be done faster without regexes:
> $array = array();
> $temp_array = explode("\n",$string);
> foreach($temp_array as $value){
> list($tkey, $tvalue) = explode(' : ',
> substr($value,strpos($value,')')+1));
> $array[trim($tkey)] = trim($tvalue);
> }


explode! That's brilliant, since now I can understand the code! This
regexp thing drives me toallally nutz! I just don't get it. It's a
programming language of its own...

 

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

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