例如:在我$this->input->post('list_id') = 68,58,47,39
如何将值xx中的字符串转换为array()?
,我想将它转换为array(68,58,47,39);
请帮助我,谢谢。
例如:在我$this->input->post('list_id') = 68,58,47,39
如何将值xx中的字符串转换为array()?
,我想将它转换为array(68,58,47,39);
请帮助我,谢谢。
<?php
explode(',', '68,58,47,39');
你可以用爆炸来转字符串与特殊分隔符的数组,并使用爆炸这样的:
explode(',', $this->input->post('list_id'));
使用本
$data = explode(',',$this->input->post('list_id'));
阅读[爆炸()](http://php.net/manual/en/function.explode.php) – Saty