You are here: Re: Converting PERL regular expression to PHP? « PHP Programming Language « IT news, forums, messages
Re: Converting PERL regular expression to PHP?

Posted by Sven Lauritzen on 09/28/05 05:36

Am Dienstag, den 27.09.2005, 17:17 -0700 schrieb Con:
> Hi, I'm in the process of converting some PERL to PHP. Thus, is it
> possible to leave the following line as is:
>
> if ($id =~ /vvvvv/g) {

The php equivalent is

if(preg_match('/vvvvv/', $id)) {

I'm quite sure that you won't need the "g".

See
http://www.php.net/manual/en/function.preg-match.php

Best regards

Sven
--
Sven Lauritzen
--------------------------------------------------------------------
mailto: the minus pulse at gmx dot net

pub 1024D/95C9A892 sub 1024g/D30E490F ABCDEFGHIJKLM
Fp 2FA9 FC9B 078C 5BC7 87DC 0B0D 2329 94F6 95C9 A892 NOPQRSTUVWXYZ
--------------------------------------------------------------------

 

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

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