...

View Full Version : Functions help



srule_
07-25-2007, 05:14 PM
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.

daemonkin
07-25-2007, 05:24 PM
You need to look at the PHP Manual (http://www.php.net/manual/en/) 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.

timgolding
07-25-2007, 05:51 PM
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 :)

whizard
07-25-2007, 07:17 PM
Specifically, here (http://php.net/manual/en/funcref.php) is the list of functions

HTH
Dan

GJay
07-26-2007, 12:00 AM
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.

zro@rtv
07-26-2007, 12:03 AM
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.

StupidRalph
07-26-2007, 07:43 AM
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.


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. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum