PHP – convert Vietnamese character between VNI and Unicode

Why I need it? VNI here stands for VNI Encoding, a way to store Vietnamese characters without using Unicode in 1990s ans 2000s. In fact, many Vietnamese old documents used it instead of Unicode. When working with a new web project, a client requires me to build their website with Unicode (of course!) but the … Continue reading PHP – convert Vietnamese character between VNI and Unicode

Custom string error in CodeIginter where clause

What is the trouble? Base on CodeIgniter Database class user guide, you can pass a custom string directly to the where clause by the $this->db->where() method. Let see the flowing example, suppose that you have successfully initiated your database. ... $val = 1; $this->db->where("id='".$val."'"); $this->db->get('mytable'); ... You are sure that your table has a field … Continue reading Custom string error in CodeIginter where clause

How to use Codeigniter pagination

The pagination and the CodeIgniter framework When you want to present a long list of data, the pagination becomes a useful way to give your users the best interactivity. This makes pagination supported as a class in CodeIgniter framework. Unfortunately, despite of what developers said on the user guide, using this class is not easily … Continue reading How to use Codeigniter pagination

Convert date time data between php servers and user browsers

You need this because: Your web server is in a fixed location when your users can be in any country all over the world, Our world doesn't use the same clock but it's divided in to 24 parts called timezones You need to get, manipulate or display current date time between your web server and … Continue reading Convert date time data between php servers and user browsers