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
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    252
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Need help with variables/includes

    I have two php pages, the first of which has a "config section"

    In the config section of the first page, I would like to have the ability to designate a variable f or c, which would change the $units='f', which is in a function on the second page here:

    PHP Code:
    function getWeather($zip$units='f') { 
    Help! :)
    Last edited by Errica; 03-04-2007 at 10:10 PM.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Just set the variable(say $default_unit):
    PHP Code:
    $default_unit 'f'
    and change the function call to:
    PHP Code:
    getWeather($zip$default_unit); 


  •  

    Posting Permissions

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