[PHP] How to know if string is encoded as UTF8 (Unicode?)
The method below was presented in php.net site and it works as intended for the most of time. Here is code to convert the string if string is encoded as UTF8.
[JavaScript] How to stop browser back button
This code is not mine and it is copied from Stack Overflow as usual. More detailed information about history.pushState can be seen HERE. Here is another link for popstate.
[Story] User Manual
My dear friend, Darwin who is hated mostly by religion leaders, is dying from an unknown and incurable disease. I may know what that disease is but I am no one but a historian who like to dig into ancient documents and there is nothing I can do except being a good company to him […]
[PHP] Allow access to PHP file for AJAX call only from files on local server
It is worthwhile to check with phpinfo() function if sever variables are all available for your server to implement the code as below.
[PHP] How to list files in a directory
The glob() function is used to get an array of filenames or directories. Then, array_multisort() function is sorting filenames according to the file’s created time. Lastly, it can be presented as intended with foreach looping.
[DB] How to select random rows from a table
It is needed to select some records randomly to take sample data from a table. MySQL can accomplish this task by using rand() function in order by clause as below. In case selecting 20 users randomly. In case it has to be ordered by name
[PHP] How to Upload a file
Not like any other post variables, file element information is posted as two dimensional array. So, getting post data for a file element can be accomplished as below.
[Story] Janitor’s Key Box
As a time patroller, we are supposed to carry this collection of keys all the time. This collection contains all of keys used on every computer on Earth and we call it Janitor’s key box. After patrol duty is over, we are supposed to cross check our JKB to the master copy of JKB to […]
[Story] Push pin

“Father! I crafted the Universe but I am not able to hang it in space.” “Son! Ask your mom for a help.” “Mom! How to hang the Universe in space.” “Son! Use one or two of push pins. They are in the drawer labelled as ‘Black hole’.” “Mom! I found them. I may use two […]
[PHP] mail accented or special characters in subject field
The problem I had was that email with French subject was sent with no subject. Because subject field is one part of header in email, accented characters in header seemed to cause problem. First attempt to fix this problem was to encode the subject field in unicode as below but the issue persisted. [code language=”PHP”] […]