note 21045 added to function.eval

From: Date: Fri, 26 Apr 2002 13:19:20 +0000
Subject: note 21045 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-29877@lists.php.net to get a copy of this message
I couldn't find a way to convert a single quote string to double quote! I finally found that by using eval() I can to the convertion. That way PHP evaluates all variables contained inside the string: $myvar = 'Hello World!'; $mystring = '$myvar'; echo $mystring; /* --> $mystring */ eval ( "echo \"" . $mystring . "\";"); /* --> Hello World! */ -- http://www.php.net/manual/en/function.eval.php http://master.php.net/manage/user-notes.php?action=edit+21045 http://master.php.net/manage/user-notes.php?action=delete+21045 http://master.php.net/manage/user-notes.php?action=reject+21045

« previous php.notes (#29877) next »