Insert special characters to a string for web address (PHP question)
<p>I posted this question last week, but I wasn't very clear on what was needed. So I'm reposting right now.</p>

<p>I have a string stored in a database, which looks something like this:</p>

<p><code>&lt;5u79cfda 4d01ga3a 11c833f9 7b52df2a 7g210252 e21b01fa a73d3463 9ge0e412&gt;</code></p>

<p>I'm trying to insert this into a web address, but needs to be encoded properly for it to work. I'm running a query to obtain the script:</p>

<p><code>$result = mysql_query("SELECT cPushID FROM tblUsers WHERE intUserID='20' AND Length(cPushID) &gt; 70");</code></p>

<p><code>$pid = mysql_fetch_row($result);</code></p>

<p>Then trying to insert it into this web address to be executed:</p>

<p><code>file_get_contents("http://domain/test.php?msg='Test!'&amp;to=$pid");</code></p>

<p>How do I properly insert this string into the web address so it will be read properly upon execution.</p>

<p>Thanks for your help.</p>
