note 7210 modified in ereg_replace by ronabop

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

« previous php.notes (#3342) next »