如何将字符串值xbox转换为array()? [重复]

This question already has an answer here:

Ex: In my $this->input->post('list_id') = 68,58,47,39

And i want to convert it to array(68,58,47,39);

Please help me, Thanks.

</div>
<?php
explode(',', '68,58,47,39');

You can use the explode function to explode a string using a delimiter to an array. When you want to paste the array together with 'glue' you may use implode :)

<?php
$array = explode(',', $this->input->post('list_id'));

You can use explode to trans a string to an array with special seperators, and use explode like this:

explode(',', $this->input->post('list_id'));

use this

$data = explode(',',$this->input->post('list_id'));