Solved

stupid question

Posted on 2009-05-12
3
332 Views
Last Modified: 2012-05-06
I am doing some stuff in php.
I am a java guy, but the php has been going swimmingly

except i am stumped

    $usingNewCssStuff = false;
    if ( $UserSiteInfo->$layout > 0 ){
        $usingNewCssStuff = true;
    }
    print "-->usingNewCssStuff[".$usingNewCssStuff."]<BR>";

The print out is always []

can someone please explain.

It has to bee something stupid

thanks

0
Comment
Question by:paries
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Assisted Solution

by:ycTIN
ycTIN earned 100 total points
ID: 24370828
boolean variable is invisible in html

you need some function to convert it

e.g.
var_export()
var_dump()

<?php
    $usingNewCssStuff = false;
    if ( $UserSiteInfo->$layout > 0 ){
        $usingNewCssStuff = true;
    }
    print "-->usingNewCssStuff[".var_export($usingNewCssStuff,true)."]<BR>";
?>

Open in new window

0
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 300 total points
ID: 24370911
I often do this with the ternary operator (?:), like this:
print "-->usingNewCssStuff[".($usingNewCssStuff?'true':'false')."]<BR>";

Open in new window

0
 
LVL 11

Assisted Solution

by:BrianMM
BrianMM earned 100 total points
ID: 24372568
Just a quick observation... if layout is a property of an object...  it should be accessed as;

$UserSiteInfo->layout       --- no $
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question