Re: ereg_replace with unser defined function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# frank.arensmeier@xxxxxxxxxxxxxxxxx / 2006-10-09 09:46:01 +0200:
> Is it possible to have a user defined function for the replacement  
> within an ereg_replace (like preg_replace_callback)? I am working on  
> a script that converts html pages with metric data into imperial  
> data. My script takes text strings containing one or more instances  
> of e.g. "123 mm", "321 mm", "123 kg", "123 cm2" and so on. The script  
> searches the string with a pattern like:
> "([[:digit:]]+|[[:digit:]]+\.[[:digit:]]+)([[:blank:]]?)(mm)"

    your pattern is valid PCRE AFAICS. why don't you just use
    preg_replace_callback? it's faster, more capable...

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux