Code Search for Developers
 
 
  

utf8.php from guliverkli at Krugle


Show utf8.php syntax highlighted

<?php

function code2utf8($num)
{
	if($num < 128) {return chr($num);}
	if($num < 2048) {return chr(($num >> 6) + 192) . chr(($num & 63) + 128);}
	if($num < 65536) {return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);}
	if($num < 2097152) {return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);}
	return '';
}

function html2utf8($str)
{
	return preg_replace( '/&#(\\d+);/e', 'code2utf8($1)', utf8_encode($str));
}

?>



See more files for this project here

guliverkli

Home of VobSub, Media Player Classic (MPC) and other misc utils.

Project homepage: http://sourceforge.net/projects/guliverkli
Programming language(s): C,C++,PHP
License: other

  DataBase.php
  MySmarty.class.php
  imdb.php
  isolang.inc
  utf8.php