Re: Re: Storing Variable & Function Info

From: Date: Wed, 24 Jul 2002 21:11:41 +0000
Subject: Re: Re: Storing Variable & Function Info
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-20756@lists.php.net to get a copy of this message
On Wed, 24 Jul 2002 16:49:38 -0400 Martin Clifford "Martin Clifford" <MLC1@nrc.gov> wrote: > You're trying to use double quotes, in which the variable is > evaluated and the stored value is shown, right? Try using single > quotes. For example, with $name = "Martin". > > echo "My name is $name."; > OUTPUT: My name is Martin. > > echo 'My name is $name.'; > OUTPUT: My name is $name. > > It's interpreted literally, so you could store it in your database > as such. HTH > > Martin Clifford Thank you, Martin, for your informative response. If I understand correctly what you're saying, it would work to do (in psuedo code and reduce to simplest form): store_to_db(text = "My name is $name.") The at runtime I could do: get_from_db(text) $name = 'Raquel' echo "My name is $name" OUTPUT: My name is Raquel Is that correct? What I'm trying to do is to create a web page where users can create their own page text, store it into a database along with certain available variables or functions, then display that page. -- Raquel ============================================================ As a rule, there is no surer way to the dislike of men than to behave well where they have behaved badly. --Lew Wallace

« previous php.db (#20756) next »