Build a website in Arabic language

I saw a website like this i.e. I want to build same kind of website in Arabic website. I was wondering does entries into database table also needs to be done in Arabic or English?

What if i need the website in 2 languages i.e. english and arabic. In what language should data should be entered in DB.


Take a look at comprehensive article: (Thanks to @Deceze for great article)

It also has Arabic example with other languages:

Yes you should insert data in Arabic in db table. So you can read it easily in web page and no need to convert.

And use utf-8 encoding while displaying the page

Usually unicode is all that is needed (UTF-8).

Your source file should be encoded UTF-8 if you want to write arabic in the PHP source. Note that some text editors don't support arabic properly.

For the database, just create your database with UTF-8 encoding.

For HTML output, add this to your HEAD section:

<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />

Alternatively, you can send it as HTTP header... but why bother.

Anyway, I have encoutered a problem generating Arabic sentences as images in GD - using a custom font. Turns out GD doesn't render arabic properly (at least in my case).

That was solved using the following library:

(yes the website is pretty ugly, but the library works, is well packaged, contains documentation...)

All I had to do, in my case, to fix the problem, is:

$Arabic = new I18N_Arabic('Glyphs');
$text = $Arabic->utf8Glyphs($_GET['txt']);

And then feed $text to GD. I'm encountering a minor problem with text direction, though, and looking for a solution. But at least I have valid arabic now.

But in most cases you won't need that library, but will just need to make sure that you're using UTF-8 in all your development process.

Hope it helps.

Need Your Help

Accessing the project system from a Visual Studio MEF Editor extension

.net visual-studio mef vsx

I'm writing a Visual Studio editor extension using the VS 2010 SDK RC. I'd like to be able to figure out what the references of the current project are. How do I get access to the project corresp...

how to changed editext values from first to last in customise listview in android

android android-listview

i am getting menunames from database then append to the custom listview edittext . now i am changing some values in edittext . i want all values with changed values of edittext into array