Deathead
asked on
Function cal in eregi_replace()
Greetings all,
I need to call a function each time php replaces a string with ergei_replace. here is the code:
# Mathes %HZE_*
$RX_E_P = '%HZE_([[:alpha:]/_0-9]*)' ;
# Mathes %HZI_*
$RX_I_P = '%HZI_([[:alpha:]/_0-9]*)' ;
# Mathes <HAZEL_DATE[*]>|<HAZEL-DAT E[*]>
$RX_D_P = '(<[[:space:]]*HAZEL_DATE[ ^>]*>)|(<[ [:space:]] *HAZEL-DAT E[^>]*>)';
$DATE_VAR = 'HZDATE';
reset($StringTemp);
while(list($k,$v)=each($St ringTemp))
{
if(eregi($RX_E_P,$v) && $v = str_replace('"','',eregi_r eplace($RX _E_P, (STRING) h3m_get("QUERY","\\1") ,$v)))
{
echo "$v\n";
#$outTemp[$k] = '"'.h3m_get("QUERY","$v"). '"';
}
elseif(!eregi($RX_D_P,$v) || !$outTemp[$k] = eregi_replace($RX_D_P,h3m_ get("QUERY ","$DATE_V AR"),$v))
{
$outTemp[$k] = $v;
}
I Know that PHP is not calling the function because I have the function set to echo each time it is called and it isn't echoing.
thanks
~Jay
I need to call a function each time php replaces a string with ergei_replace. here is the code:
# Mathes %HZE_*
$RX_E_P = '%HZE_([[:alpha:]/_0-9]*)'
# Mathes %HZI_*
$RX_I_P = '%HZI_([[:alpha:]/_0-9]*)'
# Mathes <HAZEL_DATE[*]>|<HAZEL-DAT
$RX_D_P = '(<[[:space:]]*HAZEL_DATE[
$DATE_VAR = 'HZDATE';
reset($StringTemp);
while(list($k,$v)=each($St
{
if(eregi($RX_E_P,$v) && $v = str_replace('"','',eregi_r
{
echo "$v\n";
#$outTemp[$k] = '"'.h3m_get("QUERY","$v").
}
elseif(!eregi($RX_D_P,$v) || !$outTemp[$k] = eregi_replace($RX_D_P,h3m_
{
$outTemp[$k] = $v;
}
I Know that PHP is not calling the function because I have the function set to echo each time it is called and it isn't echoing.
thanks
~Jay
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you.
ASKER
I thank you for your comment. I have already found the proper solution which was to use the preg_replace() with the 'e' modifyer.
I will still award the points as your comments show that you were most definately trying to help.
Thank you again,
~Jay