我在表单上有以下一系列复选框的示例:
<?php
echo $this->Form->input(
'reason', array(
'label'=>false,
'type' => 'select',
'multiple' => 'checkbox',
'options' => array(
'Contact me' => 'Contact me',
'Brochure request' => 'Brochure request',
'Demonstration request' => 'Demonstration request',
'Training' => 'Training',
'Support' => 'Support',
'Other' => 'Other'
)
));
?>
然后将其设置为控制器中的变量,例如:
$this->set('reason', $this->data['Contact']['reason']);
然后在电子邮件模板中我尝试过这样做:
<?php var_dump( implode( ', ', $reason ) ); ?>
结果如下:string(28) "Contact me, Brochure request"
如何删除这些引号和 string(28) 前缀?
这样做的最佳方法是什么?谢谢