I am new to CakePHP. I try to create a select box in PHP. But When I add unicode text to options value, the box get empty options.
Here is explain with code:
This code give 2 blank options, and empty option as "Select City":
**$cities = array('1'=>'Hà Nội','2'=> 'Hồ Chí Minh');**
echo $this->Form->input('city_id', array(
'label' => __d('users', 'City'),
'options' => $cities,
'empty' => __d('users', 'Select City'),
));
These codes give correct options:
**$cities = array('1'=>'Ha Noi','2'=> 'Ho Chi Minh');**
echo $this->Form->input('city_id', array(
'label' => __d('users', 'City'),
'options' => $cities,
'empty' => __d('users', 'Select City'),
));
Please note the different line of code: $cities = array('1'=>'Ha Noi','2'=> 'Ho Chi Minh');
I appreciate your helps.