note 9005 deleted from Strings by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Wed, 11 Oct 2000 01:20:25 +0000 |
| Subject: | note 9005 deleted from Strings by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6343@lists.php.net to get a copy of this message | ||
If you try to get text input from a form and then output it to a file you get a bunch of escape
characters flying around. Here's some code which I hope can effectively fix this:
function remSlash(&$targ, $source)
{
$i = 0;
$x = strlen($source);
while($i < $x)
{
if($source[$i] != "\")
$targ .= $source[$i++];
else if(($targ[$i] == "\") && ($source[$i+1] == "\")){
$targ .= "\";
$i+=2;
}
else
$i++;
}
}
I hope such a function doesn't already exist :P