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 7 of 7

Thread: Functions help

  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts

    Functions help

    hey, I am a newbie to PHP and a have a simple question about using functions.

    It seems for more tasks there is no need to make your own function as one of php's built in functions can do the job. However since I am new to PHP i do not know when php already has a function that will suit my needs.

    Since there are thousands of built in functions i wanted to know how do you know if there is already a php funtion u can use or if u must make your own.

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts
    You need to look at the PHP Manual and just search in the area you are using - MYSQL, Int, Array etc

    Or do a google for php and a description of what you are after and that should give you some function names that you can then search on PHP Manual

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com

  • #3
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    I'm constantly making functions to do something that i could of done in one line of code. Usually a good search will return something on the subject. But i quite often ask in here and get a response from a codingforum guru
    You can not say you know how to do something, until you can teach it to someone else.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Specifically, here is the list of functions

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #5
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    the php.net website is quite clever, in that trying to load http://php.net/<function_name> will make a guess if the name you try doesn't exist. I often find myself forgetting the exact name of a function and find that really useful.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #6
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post
    Also, unlike the norm of the internet, the comments on php.net are generally VERY useful, containing awesome functions, examples, explanations, fixes, and bug reports that will often go well beyond the 'official' documentation.

    Be sure to read them, I almost always find them a help.
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #7
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Quote Originally Posted by GJay View Post
    the php.net website is quite clever, in that trying to load http://php.net/<function_name> will make a guess if the name you try doesn't exist. I often find myself forgetting the exact name of a function and find that really useful.
    Quote Originally Posted by zro@rtv View Post
    Also, unlike the norm of the internet, the comments on php.net are generally VERY useful, containing awesome functions, examples, explanations, fixes, and bug reports that will often go well beyond the 'official' documentation.

    Be sure to read them, I almost always find them a help.
    Agreed! Especially....well with both of 'em. I'm always forgetting the names of the obscure functions and the comments are a gold mine. Especially, if you need a new function that doesn't exist in your version of PHP.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.


  •  

    Posting Permissions

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