urlencode or rawurlencode, depending on if you want spaces as + or %20.
deceze
2010-07-16 01:15:39
urlencode or rawurlencode, depending on if you want spaces as + or %20.
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
rawurlencode("<$txt>");
edit: the question has evolved into a mysql question, here's a short answer
$res = mysql_query("SELECT `this` FROM `that`");
$row = mysql_fetch_row($res);
$this = $row[0];
or
$res = mysql_query("SELECT `this` FROM `that`");
$row = mysql_fetch_assoc($res);
$this = $row['this'];