Explode string by one or more spaces or tabs
$parts = preg_split(‘/\s+/’, $str);
$parts = preg_split(‘/\s+/’, $str);
Try about using: $output = preg_split(‘/ (@|vs) /’, $input);
You can do the following using array_map: $new_arr = array_map(‘trim’, explode(‘,’, $str));
You can achieve this by following code, $integerIDs = array_map(‘intval’, explode(‘,’, $string));
Try explode: $myString = “9,admin@example.com,8”; $myArray = explode(‘,’, $myString); print_r($myArray); Output : Array ( [0] => 9 [1] => admin@example.com [2] => 8 )