How to grab seperated integers from long string

前端 未结 3 1754
误落风尘
误落风尘 2020-12-22 05:58

I am working on a enrollment system for a judo club. I am using a string to store the ID\'s of people, who showed up. It looks somthing like this:

0,3,4,7,8,10,

相关标签:
3条回答
  • 2020-12-22 06:24
    $str = '0,3,4,7,8,10';
    $arr = explode(',',$str);
    
    0 讨论(0)
  • 2020-12-22 06:36

    Use explode()

    $ids = explode(',', '0,3,4,7,8,10');
    
    0 讨论(0)
  • 2020-12-22 06:36

    use EXPLODE

    $num = "0,3,4,7,8,10";
    $pieces = explode(",", $num );
    
    • Explode Manual
    0 讨论(0)
提交回复
热议问题