Splitting a string into bi-grams, ignoring certain labels
<p>Consider the following string:</p>

<pre><code>I have had the greatest {A} {B} day yesterday {C}
</code></pre>

<p>I want to create an array with bi-grams, ignoring all labels (labels are between {brackets})</p>

<pre><code>[0] =&gt; I-have
[1] =&gt; have-had
[2] =&gt; had-the
[3] =&gt; the-greatest
[4] =&gt; greatest-day
[5] =&gt; day-yesterday
</code></pre>

<p>In PHP, what is the best way to do this? Using regex or exploding on " " and then iterating through all the words? I'm having trouble starting of here, so any help would be greatly appreciated :)</p>
