String to array of Integers php

后端 未结 5 2029
攒了一身酷
攒了一身酷 2020-12-07 01:47

I wan to convert a string for example 1,2,3,4,5,6 to an array of integers in php? I find functions that only have access to the first character of the string for example 1.

5条回答
  •  醉酒成梦
    2020-12-07 02:34

    explode(",",'1,2,3,4,5,6,7,8,9');
    

    http://www.php.net/manual/en/function.explode.php

提交回复
热议问题