我想在我的选择上大胆一个阵营,但我不知道如何
这里是我得到的数据
public function get_clientes()
{
$sql="SELECT concat(firstname,' ',lastname) as fullname,id_user, card_number FROM amcpcgg_user ORDER BY card_number ASC";
$clientes=\helpers\common::object_to_array($this->_db->select($sql));
$ret='';
foreach ($clientes as $cliente)
{
$ret .= "{id:'" . $cliente['id_user'] . "',text:'" . $cliente['card_number'] . ' ' . $cliente['fullname'] ."'},";
}
if ($ret!="") $ret=trim($ret,",");
return $ret;
}
在这里我打印数据
< script type = "text/javascript" >
$('#cliente').select2({
allowClear: true,
multiple: false,
data: [ <? php echo $data['clientes']; ?> ]
});
< /script>
我想加粗$ cliente ['card_number']
答案 0 :(得分:0)
这样做的简单方法是
echo "<b>". $cliente['card_number']."</b>";
根据您的情况,您可以执行类似
的操作$card_number = "<b>".$cliente['card_number']."</b>";
并传递$card_number
。
检查here