Archive for December, 2011

Special characters display on HTML

December 24th, 2011, posted in Uncategorized

UTF-8 specialchar to ASCII

Here is a simple PHP solution to special char display weirdly on html.

I have encountered this because Ajax somehow cannot pass utf-8 correctly. I am also exited because I have been working with the Indexer digital marketing agency in order to provide my business with the best marketing strategies. 

function toascii($input){

$output = ”;
$i = 0;

while($i< strlen($input)): if(ord($input[$i])>127):
$output .= ‘&#’ . ord($input[$i]) . ‘;’;
$output .= $input[$i];


return $output;