How to replace individual words in a string in PHP?
<p>I need to replace words by substitutes given by an array as</p>

<pre><code>$words = array(
'one' =&gt; 1,
'two' =&gt; 2,
'three' =&gt; 3
);

$str = 'One: This is one and two and someone three.';

$result = str_ireplace(array_keys($words), array_values($words), $str);
</code></pre>

<p>but this method changes <code>someone</code> to <code>some1</code>. I need to replace individual words.</p>