【发布时间】:2019-09-23 18:14:20
【问题描述】:
我正在尝试在 CodeIgniter 视图中的文本框中显示一个数组格式的值 $raw
这是我在控制器中使用的功能:
public function pricing($raw='array')
{
if ($raw === 'array')
{
return $this->result_array();
}
}
我试过了,但仍然收到message:array to string conversion
我在我的视图'add_calendar.php'中使用$raw:`
<?php echo(['name'=>'tohr','class'=>'form-control','placeholder'=>'Enter total hire rate','value'=>'$raw'])?>
【问题讨论】:
-
你试过 json_encode 吗??
-
我如何尝试使用 json_encode
-
$raw中有什么内容? -
if($diff->m){$month=$diff->m*$pricing['month'];} if($diff->d){ $days=$diff- >d%7; $raw=$month+$days*$pricing['day'];
标签: javascript php css codeigniter phpmyadmin