Right let me show you the function... then explain whats wrong =]
It is designed such that, when I add other values, it will do the same for them... Right, in my database is {site_domain} and im trying to replace it to be $site_domain (a previously defined variable).PHP Code:function replace($string)
{
$pattern[0] = "{site_domain}";
$replacement[0] = "$site_domain";
ksort($pattern);
ksort($replacement);
eregi_replace("$pattern", "$replacement", "$string");
return $string;
}
However, with and/or without the function, the end result for {site_domain} is %7bsite_domain%7d yet no where in the coding is it told to htmlspecialchars itself. And when trying to use the function but replace %7b to $, it still doesnt work -.-
Anyone got a function that will change the {x} to $x for any variable... that works =]
Moved by Agesilaus (Forum Moderator) from Design and Development: Please post in the correct forum.





Reply With Quote





