| | |
how can i make a web page having both english and hindi character with php mysql
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
1
#2 21 Days Ago
Hey.
HTML:
MySQL
And as to PHP and Javascript...
You usually don't have to worry much about the character encoding in either of those. Just make sure you create the code files themselves as UTF-8 (without BOM) and you should be fine.
PHP strings are basically just byte arrays, so they don't differentiate between charsets, unless you attempt to manipulate them using the string functions, in which case they are treated as ISO. (Unless the function offers the ability to specify a charset.)
However, if PHP is giving you trouble, you can use utf8_encode to convert ISO characters over to UTF-8.
Also, if you use htmlentities or htmlspecialchars, make sure you set the third parameter correctly.
HTML:
html Syntax (Toggle Plain Text)
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf8"> </head> <body /> </html>
MySQL
mysql Syntax (Toggle Plain Text)
-- When creating a table: CREATE TABLE `myTable`( -- <insert fields> )DEFAULT CHARSET=utf8; -- Before querying the database. -- Note, this is usually not needed, but can be. SET NAMES 'utf8';
And as to PHP and Javascript...
You usually don't have to worry much about the character encoding in either of those. Just make sure you create the code files themselves as UTF-8 (without BOM) and you should be fine.
PHP strings are basically just byte arrays, so they don't differentiate between charsets, unless you attempt to manipulate them using the string functions, in which case they are treated as ISO. (Unless the function offers the ability to specify a charset.)
However, if PHP is giving you trouble, you can use utf8_encode to convert ISO characters over to UTF-8.
Also, if you use htmlentities or htmlspecialchars, make sure you set the third parameter correctly.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
0
#3 21 Days Ago
nice info Atli... i guess it will prove helpful fr me someday
•
•
•
•
Hey.
HTML:
html Syntax (Toggle Plain Text)
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf8"> </head> <body /> </html>
MySQL
mysql Syntax (Toggle Plain Text)
-- When creating a table: CREATE TABLE `myTable`( -- <insert fields> )DEFAULT CHARSET=utf8; -- Before querying the database. -- Note, this is usually not needed, but can be. SET NAMES 'utf8';
And as to PHP and Javascript...
You usually don't have to worry much about the character encoding in either of those. Just make sure you create the code files themselves as UTF-8 (without BOM) and you should be fine.
PHP strings are basically just byte arrays, so they don't differentiate between charsets, unless you attempt to manipulate them using the string functions, in which case they are treated as ISO. (Unless the function offers the ability to specify a charset.)
However, if PHP is giving you trouble, you can use utf8_encode to convert ISO characters over to UTF-8.
Also, if you use htmlentities or htmlspecialchars, make sure you set the third parameter correctly.
Gimme reputation points if u find my post helpful.
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
![]() |
Similar Threads
- Freelance Web designer PHP, MySQL, ASP, SQL Server 2000 (Post your Resume)
- REWARD! Help me find a PHP/mySQL DEVELOPER needed (Web Development Job Offers)
- Looking for PHP / MySQL Developer (Web Development Job Offers)
- Looking for a PHP/MYSQL Programmer (Web Development Job Offers)
- Need Highly Experienced PHP/MySQL Programmer $15-$25/hour (Web Development Job Offers)
- PHP/MySQL Programmer Position (Web Development Job Offers)
Other Threads in the PHP Forum
- Previous Thread: Forget Password in PHP
- Next Thread: require() all files in a directory structure
| Thread Tools | Search this Thread |
ajax apache api array basics beginner binary broken cakephp checkbox class cms code codingproblem combobox cron curl database date display domain dynamic echo email error file files folder form format forms function functions google href htaccess html image include insert interactive ip java javascript joomla js limit link load login mail malfunctioning menu mlm mobile multiple mysql nodes oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion reference remote return script search server sessions sms source space sql syntax system table tutorial unset up-to-date update upload url validation validator variable video web webapplications websitecontactform youtube





