Page 1 of 1

string conversion

Posted: Tue Dec 04, 2007 10:35 pm
by SidewinderX
Before I start reinventing the wheel, is there a function to convert a string of characters to to its "html" form?

Code: Select all

a => & #97;
b => & #98;
c => & #99;
...

Posted: Tue Dec 04, 2007 11:00 pm
by SidewinderX

Code: Select all

$str = "";
for($i = 0; $i < strlen($email); $i++) {
    $str .= "&#" . ord($email[$i]);
}

Posted: Wed Dec 05, 2007 1:38 am
by s.dot