Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: $var

  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    $var

    I have a var, lets call it $VAR How can i display content if the var does not have a value?

    I.E if $VAR has a value of abcdefg then the text there would be abcdefg
    and if there is no value the text that would be there is "Sorry, somthing bad happened."
    ----------------------------------------------
    ----------------------------------------------

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    PHP Code:
    <?=!empty($VAR) ? $VAR 'Sorry, something bad happened.';?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •