note 104557 deleted from function.urlencode by danbrown
| From: | danbrown@php.net | Date: | Wed, 22 Jun 2011 23:49:32 +0000 |
| Subject: | note 104557 deleted from function.urlencode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180858@lists.php.net to get a copy of this message | ||
Note Submitter: konsti dot st at gmx dot ch
----
A simple way to replace only spaces:
function addSpaces($string) {
$length=strlen($string);
for($z=0;$z<$length;$z++) {
if($string[$z]==" ") $string2.="%20";
else $string2.=$string[$z];
}
return $string2;
}