Posted by Justin Koivisto on 11/19/38 11:47
grantges@gmail.com wrote:
> Hi -
>
> Does anyone know of a php function that takes a given character - ex.
> "A" without quotes and converts it into A ?
>
> If not a single function, what is the best way to accomplish this. The
> htmlentities function suite handle special characters, but my goal is
> to change average everyday letters of the alphabet as well.
>
> Thanks -
> Bert
>
function str2entities($email){
$str='';
for($j=0;$j<strlen($email);++$j){
$str.='&#'.ord($email{$j}).';';
}
return $str;
}
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|