1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

JavaScript and php-variable

Discussion in 'JavaScript' started by J.Winnfield, Feb 7, 2010.

  1. #1
    How should I do this:
    if ("<?= $php_variable ?>" =="something"){/*Do this*/}
    else {/*do that*/}
    ?
    thanks!
     
    J.Winnfield, Feb 7, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    I think you have to do like this:

    
    <?php if ($php_variable=="something"){ ?>/*Do this*/<?php }
    else { ?>/*do that*/<?php } ?>
    
    Code (markup):
     
    s_ruben, Feb 8, 2010 IP
  3. nadiralishah_webexpert

    nadiralishah_webexpert Guest

    Messages:
    229
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    seems like you gave the answer urself...
     
    nadiralishah_webexpert, Feb 8, 2010 IP