I need to replace spaces in a link with: %20
<p>It's a membership site and the problem link is the one on the members profile page which is used to contact them. It works fine if the member is single but if they are a couple and their first name is 'John and Susan' the link doesn't work.</p>

<p>The code which displays the contact link is below. How can I change it so that, if there are any spaces in the first name part, it changes them to %20?</p>

<pre><code> &lt;?php
 agent_with_listing ('  
 {lang_listed_by}: {listing_agent_first_name} - {check_agent} &lt;a rel="colorbox" href="{contact_agent_link_url}"&gt;Click here to contact {listing_agent_first_name}{/check_agent}&lt;/a&gt; '); 
  ?&gt; 
</code></pre>
