Solved

stupid question

Posted on 2009-05-12
3
333 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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 dynamically set the form action using jQuery.

734 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