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.
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.
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.
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.
"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
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
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.