note 7210 modified in ereg_replace by ronabop
| From: | ronabop@php.net | Date: | Sat, 12 Aug 2000 21:05:51 +0000 |
| Subject: | note 7210 modified in ereg_replace by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1552@lists.php.net to get a copy of this message | ||
// Remove a leading backslash from a single quote to restore<BR>
// the original form field's value. (PHP does unwanted quoting.)<BR>
$Field[$Key] = ($Value = ereg_replace('\\\\\'', '\'',
&$Value));<BR>
<BR>
//$Param .= '{' . $Key . ' "' . addcslashes($Value, '"') .
'"} ';<BR>
// A quote must be replaced by a "quote" to get a quote with a leading
backslash.<BR>
// Each single quote must be quoted in a special way to prevent the shell to execute commands in a
parameter string.<BR>
$Param .= '{' . $Key . ' "'<BR>
. ereg_replace('\'', '\'"\'"\'',
ereg_replace('"', '"', &$Value))<BR>
. '"} ';<BR>
</P>
http://www.php.net/manual/function.ereg-replace.php