Reply to Re: simple question : regular expressions

Your name:

Reply:


Posted by friglob on 08/16/06 16:56

amygdala wrote:
> "friglob" <friglob_MAKNI_SVA_VELIKA_SLOVA_I_SVE_CRTICE_@vip.hr> schreef in
> bericht news:ebvgas$ekf$1@news1.xnet.hr...
>
>>i have a string that looks something like this:
>>-1--3--8--22--550--1028-
>>
>>how to make it an array like this:
>>0 => 1,
>>1 => 3,
>>2 => 8,
>>3 => 22,
>>4 => 550,
>>5 => 1028
>>
>>also, i would like to know some good reg exp tutorials, books or whatever
>>that start from basics and that can teach me reg exp
>>
>>
>>Thank you
>
>
> <?php
>
> $string = '-1--3--8--22--550--1028-';
> $array = explode( '--', trim( $string, '-' ) );
> var_dump($array);
>
> ?>
>
> Will do the trick.
>
> Sorry, can't help you with the reg ex. But Google should provide lot's of
> info.
>
>

Just found out...

preg_split("%-%",$string_to_search,-1,PREG_SPLIT_NO_EMPTY);

Thank you for your time.

[Back to original 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

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