nationavon
MIS
I have the following function:
// convert characters to html
function convertstring($string) {
// variables
$search = array("~","`","!","@","#","\$","%","^","&","*","(",")","_","-","+","=","{",
"[","}","]","|","\\",":",";",'"',"'","<",",",">",".","?","/");
$replace = array("~","`","!","@","#","$","%","^",
"&","*","(",")","_","-","+","=","{",
"[","}","]","|","\",":",";",""","'",
"<",",",">",".","?","/");
return str_replace($search, $replace, $string);
}
If I pass it something like it returns:
http:;//or
http:;//
For some reason it is also converting the semi-colon in the first : to ;. Any ideas why this is? If I remove the semi-colon from the search array it works correctly.
Thanks,
Nathan
// convert characters to html
function convertstring($string) {
// variables
$search = array("~","`","!","@","#","\$","%","^","&","*","(",")","_","-","+","=","{",
"[","}","]","|","\\",":",";",'"',"'","<",",",">",".","?","/");
$replace = array("~","`","!","@","#","$","%","^",
"&","*","(",")","_","-","+","=","{",
"[","}","]","|","\",":",";",""","'",
"<",",",">",".","?","/");
return str_replace($search, $replace, $string);
}
If I pass it something like it returns:
http:;//or
http:;//
For some reason it is also converting the semi-colon in the first : to ;. Any ideas why this is? If I remove the semi-colon from the search array it works correctly.
Thanks,
Nathan