Simple PHP Code

Discussion in 'PHP' started by Borduhh, Dec 24, 2011.

  1. #1
    Hey Guys,

    I need some simple help with some PHP syntax:

    I have declared this variable:
    <?php $_groupedPrice = 0; ?>
    PHP:
    Now I am trying to display it here:
    <?php echo $this->$_groupedPrice ?>
    PHP:
    But it is not display anything at all. Any suggestions?

    Best Wishes,
    Nick
     
    Borduhh, Dec 24, 2011 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    <?php echo $_groupedPrice; ?>
    PHP:
     
    Last edited: Dec 24, 2011
    MyVodaFone, Dec 24, 2011 IP
  3. myworkspeaks

    myworkspeaks Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try removing the this-> and it should work well
     
    myworkspeaks, Dec 24, 2011 IP
  4. ATmega Media

    ATmega Media Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You do not have any classes there to be able to use it like that. Remove $this-> and it will work.
     
    ATmega Media, Dec 24, 2011 IP