- str_repeat: documentation ( source)
- explode: documentation ( source)
<?php
for($limit=10,$str=str_repeat(" ",$limit);$limit>=0;--$limit){
$arr=explode(" ",$str,$limit);
if(($count=count($arr)) > $limit){
throw new LogicException("explode() returned more elements than the limit! someone send a bugreport! limit: {$limit} elements: {$count}");
}
}