str::words($string)
Returns an array with all words in a string
-
$string (string)
Example
<?php
$words = str::words('Kirby is a file‑based CMS. Easy to setup. Easy to use. Flexible as hell.');
a::show($words);
Result:
Array
(
[0] => Kirby
[1] => file
[2] => based
[3] => Easy
[4] => setup
[5] => Easy
[6] => Flexible
[7] => hell
)