UTILITY

words()

Return at most N whitespace-separated words.

Signature

string words(string $text, int $limit)

Example

words('One two three four', 2); // 'One two'

Available from: 1.5.0

Reference navigation

Previous: word_count()

Next: write_json()

Back to utilities