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
    New Coder
    Join Date
    Jan 2003
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    User-defined function library?

    Hi. I hope this is a quick and easy question for you guys. I'm trying to include() a php that just has function declarations. I hoped that could be a common resource for all my pages on the site. When I try to use the functions, however, it doesn't recognize them. Is there a way to make my own library or just include them properly? I'm open to suggestions. Thanks

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    should be fine as long as the functions are included prior to the include call - and as long as the include is a php page and the contents surrounded by <?php ?> tags.

    any class of functions would be used similarly - included and then called

    func.php
    <?php
    function &doublit($arg)
    {
    $res = $arg*2;
    return $res;
    }
    ?>

    call.php
    include('func.php');
    $blat = &doublit(12);
    echo $blat;
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.


  •  

    Posting Permissions

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