Generating a php file

From: Date: Wed, 11 May 2005 20:04:55 +0000
Subject: Generating a php file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-214972@lists.php.net to get a copy of this message
You can start by clarifying. I had to read your message three times before I got a vague understanding. What I'm hearing is that you want to put something like <?php $msg = get_message(); ?> into a string? You are having difficulty doing this because you are finding that your string contains the value of $msg, instead of a doller sign, followed by 'msg'? If so, then you can: Use Single Quotes: $code = '<?php $msg = get_message(); ?>' or Escape your $-signs, by placing a backslash(\) in front of the $-sign $code = "<?php \$msg = get_message(); ?>"; On 5/11/05, Dan Rossi <php@electroteque.org> wrote: > > Hi there I am trying to generate a php file, which has variables that i > need to have in it ie $_SERVER but not actually be parsed as they need > to be in the actual script. I also need to send some variables to > assign values to other variables in the script. How is this possible ? > I have tried placing the contents of the script within a string, but > all the variables gets parsed, and the super globals cause an error. > Let me know . > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#214972) next »