Re: Ridiculous ..won't print or echo ...(RESOLVED)
| From: | Miller, Terion | Date: | Wed, 29 Jul 2009 15:47:11 +0000 |
| Subject: | Re: Ridiculous ..won't print or echo ...(RESOLVED) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296005@lists.php.net to get a copy of this message | ||
Yep just figured that out too..the escaping thing......
Thanks
On 7/29/09 10:45 AM, "Ashley Sheridan" <ash@ashleysheridan.co.uk> wrote:
On Wed, 2009-07-29 at 11:36 -0400, Miller, Terion wrote:
> Ok in my output to Quark I need to have $P printed to the page like this:
>
> <@$p>2118 S. Campbell Ave
>
> So in my php which is going to be grabbing this info and formatting it for
> the Quark....isn't echoing that "$p" all I get is the <@>
>
> I have tried several things:
>
> $p = $p
>
> $p = print("$p")
>
> $p = echo "$p"
>
> On and on...
>
> tried all kinds of ways to just get a $p to print to the page.....and I can
> not for some reason get a $p to print to the page...what's up with that....
>
>
PHP is seeing the $ and thinking that $p is a variable. As you have
errors and notices turned off, you aren't seeing the notice that you are
trying to use an undefined variable.
There are several ways to get round this:
* escape like \$
* put the $p inside of single quotes in your echo
* use an escape code for the dollar
Thanks,
Ash
http://www.ashleysheridan.co.uk