Hello, i'm trying to make a replace of a character in a string for an
'&'. I tried several ways of replacement but (cake)PHP, when I do
str_replace("_", "&") it returns "&"(HTML encoded). How can I get
the replacement to be an ampersand itself?
My code:
/**
* From client comes all special characters encoded
* HTML encoded but instead of &#NUMBER; => _#NUMBER;
* This Method restores to &#NUMBER;
**/
function restoreHTMLEcodedCharacters(&$pArray){
foreach($pArray as $key => $value){
if(is_array($value)){
restoreHTMLEcodedCharacters($value);
}else{
//debugger::log($value);
$value = preg_replace("_#", "&#", $value);
$value = str_replace("&", "&", $value);
}
}
}
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---