You are here: Re: PHP equivalent to Perl's !~ « PHP Programming Language « IT news, forums, messages
Re: PHP equivalent to Perl's !~

Posted by Toby A Inkster on 01/19/08 10:50

Michael Fesser wrote:
> .oO(wes.waters@gmail.com)
>
>>I haven't seen any documentation on this, and searching for !~ has been
>>fruitless. Any suggestions, or is there no equivalent?
>
> What about !preg_match()?
> Just a guess, since I don't use Perl.

Yep, that's correct.

Perl:

if ($foo !~ /bar/)
{
print "match\n";
}

PHP:

if (!preg_match('/bar/', $foo))
{
print "match\n";
}


--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 19 days, 22:02.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

 

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

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