Re: quote

From: Date: Mon, 16 Oct 2000 19:46:04 +0000
Subject: Re: quote
Groups: php.general 
Request: Send a blank email to php-general+get-20445@lists.php.net to get a copy of this message
On Fri, 13 Oct 2000, davidt wrote: > php-general - > > This failed.... > > $boo=false; > exec("sed -e s/$boo/true/g $pathfile > $newfile") > > So i replace $boo value with > $boo="false"; <--- add " " > and it works. This is consistent. The naked word false means the CONSTANT false. What you need is the STRING "false" with the quotes. To see the crux of the matter, try: <?php define("foo","constant"); $foo = "string"; echo foo, "<br>\n"; echo $foo, "<br>\n"; ?> You should see: constant string If you are instead just trying to substitute the strings "true" and "false" for the boolean value of a variable, try something like quotefunction (&$var) { return (isset($var) && $var) ? "true" : "false"; } (I think) HTH, Matt ---------------------------------------------------------------- Matthew Leingang http://www.math.rutgers.edu/ Rutgers University leingang@math.rutgers.edu Department of Mathematics "This signature needs no quote."

« previous php.general (#20445) next »