note 21045 deleted from function.eval by alindeman

From: Date: Fri, 26 Apr 2002 20:51:53 +0000
Subject: note 21045 deleted from function.eval by alindeman
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29891@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! */

« previous php.notes (#29891) next »