PHP:
-
function unicode_urldecode($url) {
-
-
-
foreach ($a[1] as $uniord) {
-
$utf = '&#x' . $uniord . ';';
-
-
}
-
-
}
Usage:
PHP:
-
$content = unicode_urldecode($_GET['content']);
Settings a LAMP server to work in full unicode UTF-8 :
httpd.conf:
CODE:
-
AddCharset UTF-8 .utf8
-
AddDefaultCharset UTF-8
php.ini
CODE:
-
default_charset = "utf-8"
my.cnf
CODE:
-
character-set-server=utf8 default-collation=utf8_unicode_ci
In all your PHP scripts :
CODE:
-
mysql_query("SET NAMES 'utf8';",$con);
Importing database :
CODE:
-
mysql -h host -u username -p password --default_character_set utf8 database <file.sql
Dont forget to add UTF-8 in the head of all your HTML files :
CODE:
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
http://www.turningturnip.co.uk/free-mysql-php-generator/
Knowing the time offset, you can replace all your SQL statements of
with
SQL:
-
SELECT DATE_ADD(NOW(), INTERVAL 2 HOUR);