How to replace whitespaces with dashes
<p>My idea is to remove special characters and html codes and replace the whitespaces to dashes
let us doing it step by step</p>

<pre><code>$text = "Hello world)&lt;b&gt; (*&amp;^%$#@! it's me: and; love you.&lt;p&gt;";
</code></pre>

<p>now i'm want the output become <code>Hello-world-its-me-and-love-you</code>
I've tired this code for removal of special characters and html codes </p>

<pre><code>$array = array();
$array[0] = "/&lt;.+?&gt;/";
$array[1] = "/[^a-zA-Z0-9 ]/";

$textout= preg_replace($array,"",$text);
</code></pre>

<p>Now the output will be like this <code>Hello world its me and love you</code>
so is there any way i can modify this code so that the text output become exact as i do needs <code>Hello-world-its-me-and-love-you</code></p>

<p>~ thank you</p>
