Hello all.
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.
# [EMAIL PROTECTED] / 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
Hi Frank,
I think preg_replace_callback is a good solution for you.
If you don't want to use it, you can construct two arrays defining
matches and replacements.
For example:
$matches
[230]
[120]
[340]
$replacements
[9.1]
[replace2]
[replace3]
After you stored matches in $matches using
3 matches
Mail list logo