how to make an array in php with these data

Viewed 40

i have some number data with have multipal spaces , i want to create new array in php with these data :

 211024006377   211024006381        211024006386    211024006387    211024006388    211024006390    211024006391

i have already tried :

$data = trim($_POST['roll']);
$new = explode(' ', $data);

but result is :

Array
(
    [0] => 211024006377 

)

i want such result :

Array
(
    [0] => 211024006377 
[1]=>21102400636
)

how to do it ?

1 Answers
$yourNumberData = "211024006377   211024006381        211024006386    211024006387    211024006388    211024006390    211024006391";

$numbersArray = preg_split('/\s+/', $yourNumberData);
Related