ruskam
Новичок
Как вывести начальную часть заданного текста ?
есть переменная, в которой задан любой текст, скажем
$text='Please note that pattern is a regular expression. If you want to split on any of the characters which are considered special by regular expressions, you'll need to escape them first. If you think split() (or any other regex function, for that matter) is doing something weird, please read the file regex.7, included in the regex/ subdirectory of the PHP distribution. It's in manpage format, so you'll want to do something along the lines of man /usr/local/src/regex/regex.7 in order to read it.';
---------
Вопрос: Есть ли ф-я, которая может вывести первые 12 слов этого текста ?. Если нету, то как это можно попроще организовать...
есть переменная, в которой задан любой текст, скажем
$text='Please note that pattern is a regular expression. If you want to split on any of the characters which are considered special by regular expressions, you'll need to escape them first. If you think split() (or any other regex function, for that matter) is doing something weird, please read the file regex.7, included in the regex/ subdirectory of the PHP distribution. It's in manpage format, so you'll want to do something along the lines of man /usr/local/src/regex/regex.7 in order to read it.';
---------
Вопрос: Есть ли ф-я, которая может вывести первые 12 слов этого текста ?. Если нету, то как это можно попроще организовать...

