0

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,

Now, I want to seperate each number into an integer array in PHP. What would the simplest solution to this be? :)

Venu
  • 7,243
  • 4
  • 39
  • 54

3 Answers3

3

Use explode()

$ids = explode(',', '0,3,4,7,8,10');
John Conde
  • 217,595
  • 99
  • 455
  • 496
0
$str = '0,3,4,7,8,10';
$arr = explode(',',$str);
SeanWM
  • 16,789
  • 7
  • 51
  • 83
0

use EXPLODE

$num = "0,3,4,7,8,10";
$pieces = explode(",", $num );
John Woo
  • 258,903
  • 69
  • 498
  • 492