preg_match('~\[img_list\](.*?)\[/img_list\]~s', $text, $search); // Ищем находим и берем $text = preg_replace('~\[img_list\](.*?)\[/img_list\]~s', '', $text); // Убираем найденное $img_list = preg_split('~\n~', $search[1]); // найденное разбиваем на массив, к примеру 3 элемента. The fact is that further with these elements I will work. But elements must be numbered from 1 to so on.