Im fetching an array from my sql database, but the string has spaces in it (ie B54DT45 GDT4563 HaK7698).
This needs to go into a webadress like %30B54dT45%20 so that the outcome is
Here is my code:
$pid = mysql_query(“SELECT cPushID FROM tblUsers WHERE intUserID=’20’ AND Length(cPushID) > 70 AND cAlerts = ‘All'”);
$url = rawurlencode(“”);
$msg = “test”;
file_get_contents(“http://domain/push.php?msg=$msg&to=$url”);
The string in the database is something like as an example. That exact string needs to be send to the push.php script on the remote server for it to run correctly
rawurlencode()because the space must be %20 according to the question.
edit: the question wasn’t very clear, but to add < and > before encoding, just do
edit: the question has evolved into a mysql question, here’s a short answer
or