SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    created function already?

    Im having a trouble where a function is being created twice in a script via includes being included on includes...anyways.. is there a funtion or soemthing that detects if a function is created then if it isnt, it will be created.

    will

    if(!function())
    {
    //make function
    }


    work??

  2. #2
    SitePoint Evangelist ucahg's Avatar
    Join Date
    Apr 2001
    Location
    Sarnia, Ontario, Canada
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if that would work, but you could register a global variable $[function_name]_isset. Then just check if it's the value you set it at. If it is not, then the function has not been set.

    Hope this helps.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    lalal
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    www.php.net/include_once for your problem,
    www.php.net/function_exists to check a functions existance


Bookmarks

Posting Permissions

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