开发者

Strange output 'Array' with php / codeigniter

Hi I was following code igniter user guide for forms and I encountered this strange output can anyone tell how to fix it?

Here is my code for beginning of the form

<?=$attributes = array('class' => 'email', 'id' => 'myform');?>
<?=form_open('email/index/', $attributes); ?>

I get form with id and class which I specified above but for some reason annoying Array text prints out and I cant figure out why, can anyone help? t开发者_如何学Pythonhank you


Try

<? $attributes = array('class' => 'email', 'id' => 'myform');?>
<?=form_open('email/index/', $attributes); ?>

The <?= ?> is a shortcut to <?php echo ... ?>, so your $attributes array would not only be created, but also printed.

The <? ?> is a shortcut for <?php ?> so that should fix it.


You are evaluating an Array type variable to a string somewhere. It may have nothing to do with the form. Were you trying to echo/print somethign else up higher in the processing chain for debug that happens to be an array?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜