I am trying to convert strings to numbers using an array with keys as a lookup table.
This is the array:
$q2_10_lt = array(\"Full-time worker\" => 1
I ended up changing my table column encoding to utf8_general_ci
and table collation to utf8_general_ci
. I also added the following lines of code to my php file:
ini_set('default_charset', 'utf-8');
//set encodig to utf-8
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
It is working now, but I could be doing something not recommended?