str_replace “|” using php
<p>I want to insert <code>"|"</code> in place of space <code>" "</code> using <code>str_replace</code>, but when I use it</p>

<pre><code>str_replace("|", " ", $word);
</code></pre>

<p>All space between the words were deleted. Any help?</p>

<p>-- The code</p>

<pre><code>$word=explode(" ",$FromForm);
$word_count - str_word_count($_post['xxx'];
for($i=0;$i&lt;=$word_count;$i++) {
   echo str_replace("|"," ",$word[$i]);
   //it echos fine without the string replace
}
</code></pre>
