how to replace a string contains space with -
<pre><code>$url_name = str_replace(" ","-",$entry['department_name']);
$url_name = str_replace(" &amp; ","-amp-",$entry['department_name']);
</code></pre>

<p>Hi iam replacing space with - using str_replace and using for loop to print all departments what if department name consists of something like that media &amp; communication.for department having space it working fine but what if  it contains like media &amp; communication.if i use both one is working the other is not working</p>
