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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    North East England
    Posts
    853
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making functions

    Hi
    this is probably really simple and something I've eitehr unwittingly done before or should know BUT... how do I create a function and how do I call it later?

    feelin' stoopid already...
    [+] Computer/PC issues [+] Silverpaw3D
    ------------------------------------------------
    Never buy a dwarf with learning disabilities...

    ...it's not big, and it's not clever.

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    I'm too lazy to type today so here is a small tutorial with simple examples:

    http://softwaredev.earthweb.com/serv...6891_2,00.html


    If you know how to do functions in javascript then you know how to do them in PHP. They are pretty much identical.


    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    And if you really want to be cool then you would want to get into creating PHP classes:

    http://www.devshed.com/Server_Side/PHP/Class/page1.html

    This works a lot like Java. You can create a class which could be full of functions/methods for doing specific kinds of tasks. Then you simply need to create an instance of that class and access the methods within it. Makes for more organized coding and modularity and stuff.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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