I have following code:
<?php
$select_options = array();
foreach($delivery_options as $option)
{
$select_options[$option->getDeviceId()] = $option->getDeviceName();
echo $select_options[$option->getDeviceId()];
}
echo $this->Form->input('default_device', array(
'type' => 'select',
'options' => $select_options,
'value' => $default_device,
'label' => '',
));
?>
In foreach loop every echo returns this:
abc'abc
In html source code it looks like this abc'abc
and then in select input: abc'abc
In html source code: abc&#39;abc
It means that & char from abc'abc was converted to it’s html encoding – & – but how did it happen?
I also tried htmlentities() and htmlspecialchars() but this still doesnt help…
Try setting it to false.