catch $variable with spaces, and convert them
| From: | Louie Miranda | Date: | Mon, 19 Jul 2004 05:31:29 +0000 |
| Subject: | catch $variable with spaces, and convert them | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-190975@lists.php.net to get a copy of this message | ||
Is it possible to catch $variables coming from a database that have
spaces? my program generates something out of a database and just
display them. now i did have an option for them to download the files,
but some of my files have spaces. the quick way for me to do it is add
"%20" for all spaces on the filename.
My problem now is, i dont know how to catch spaces and convert them to "%20"
## code, using PEAR DB ##
while ($q->fetchInto($row)) {
print ("
<tr>
<td width=90 align=center>" .$row[0]. "</td>
<td><a href=FILES/" .$row[1]. ">" .$row[1]. "</a></td>
<td>" .$row[2]. "</td>
</tr>
");
};
## end of code ##
thanks
--
Louie Miranda
http://www.axishift.com