www.webdeveloper.com
Results 1 to 3 of 3

Thread: simple FUNCTION question

  1. #1
    Join Date
    Jun 2006
    Posts
    204

    simple FUNCTION question

    is there a way to put custom functions in an external script and then call them? even if they require variables? I have this one function I wrote that I would like to use in multiple scripts

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,916
    file functions.php:
    PHP Code:
    <?php
    function hello($string)
    {
      echo 
    "Hello, $string\n";
    }
    function 
    goodbye($string)
    {
      echo 
    "Goodbye, $string\n";
    }
    ?>
    Any script:
    PHP Code:
    <?php
    require_once "functions.php";
    hello("Firman");
    goodbye("NogDog");
    ?>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jun 2006
    Posts
    204
    NogDog.... You keep coming up with great answers for ALL my questions... THANK YOU

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