You are here: Re: RegExp for a substring « PHP Programming Language « IT news, forums, messages
Re: RegExp for a substring

Posted by Paul Lautman on 06/14/06 13:17

Csaba Gabor wrote:
> Rik wrote:
>> Csaba Gabor wrote:
What it seems that you're trying to achieve is similar to REXX's ABBBREV
function. This takes 3 arguments thus:

Abbrev( information, info [, length ] ] )

information -- reference string
The string that may start with the abbreviated text value.

info -- test substring
The abbreviated text value.

length -- minimal substring length
The minimal required length of the test substring -- the default minimum
length is 0 !

Which I would solve like this:

function abbrev($full,$part,$len=0) {
return !(strlen($part)<$len || substr($full,0,strlen($part)) !== $part);
}

 

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

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