PHP String into array keyed by word start
<p>Say I have the following string</p>

<pre><code>$str = "once in a great while a good-idea turns great";
</code></pre>

<p>What would be the best solution to creating an array with the array key being the string count of where the word(s) starts?</p>

<pre><code>$str_array['0'] = "once";
$str_array['5'] = "in";
$str_array['8'] = "a";
$str_array['10'] = "great";
$str_array['16'] = "while";
$str_array['22'] = "a";
$str_array['24'] = "good-idea";
$str_array['34'] = "turns";
$str_array['40'] = "great";
</code></pre>
