If knowledge is power, then sharing knowledge is ultimate powertrip
You are here: Home >> PHP >> Develop multilingual website in php

Develop multilingual website in php

I’ve been working to develop multilingual website in php that grabs data from Hebrew news sites into a mySQL database.

While working on this mini-project I’ve realized that there is hardly any online tutorials on using the Hebrew font. Here’s my solution which is fairly simple and works effectively.

Step 1) Set the HTML page charset encoding to utf8:

meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8

Step 2) set the ‘collation’ attribute for the fields which are to accept hebrew text to: utf8_bin

Step 3) within your php script, right before calling the mysql_query function to insert the data into your DB, use both the utf8_encode function along with addslashes. This will encode the data into utf8 friendly characters.

Step 4) when pulling the text from the DB onto the page, make sure to use the utf8_decode along with stripslashes in order to display the data on the page.

About Jawed Shamshedi

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Scroll To Top