www.webdeveloper.com
Results 1 to 6 of 6

Thread: 2 questions about functions in PHP...

  1. #1
    Join Date
    May 2003
    Posts
    225

    2 questions about functions in PHP...

    Is thre a function in PHP that will return TRUE or FALSE if a function is set or not(without calling it!)?
    (... if(isfunctionset(function)){}else{} ...)
    I am just wondering...

    and, Can you edit a global variable inside a function?
    PHP Code:
    $my_not_your_global_var '';

    function 
    change($add ''){
    $my_not_your_global_var .= @$add;

    I am having trouble with the second one mostly.

    An awnser to these questions would make my life programing life a lot more easy!
    Last edited by diamonds; 07-17-2003 at 02:43 PM.

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    On number one, I don't think so...

    On number two, you need to define them as global variables:

    PHP Code:
    <?PHP
    function change($add "test"){
        global 
    $my_not_your_global_var;
        
    $my_not_your_global_var $add;
    }
    change();
    echo 
    $my_not_your_global_var;
    ?>

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  3. #3
    Join Date
    May 2003
    Posts
    225
    wheew-- almost posted another thread(silly me)

    Great! can you explain what the change function does?

  4. #4
    Join Date
    May 2003
    Posts
    225
    Oh--- nevermind! I see it!

  5. #5
    Join Date
    May 2003
    Posts
    225

    works great!

    Thanks!

  6. #6
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    You're welcome...

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles