Я пытаюсь разделить строку на массив. Это мои данные:
1. Some text is here!!! 2. Some text again 3. SOME MORE TEXT !!!
Мне бы хотелось, чтобы массив был таким:
Array(
[0] => '1. Some text here!!!
[1] => '2. Some text again
etc..
);
Я пробовал это с помощью preg_split, но не получилось.
$text = "1. Some text is here!!! 2. Some text again 3. SOME MORE TEXT !!!";
$array = preg_split('/[0-9]+./', $text, NULL, PREG_SPLIT_NO_EMPTY);
print_r($array);
Подробнее здесь: https://stackoverflow.com/questions/203 ... flat-array
Мобильная версия