Talk:PHP/25 Essential Functions

Latest comment: 16 years ago by Kev in topic Style


I'm proposing the following format for each function listing:

== [ Function name ] ==
type name ( type argument1 , type argument2 )
[ Brief description of function ]
=== Usage ===
[ Basic usage examples ]
=== Practical applications ===
[ Use in some practical application that allows it to qualify as 'essential' ]
=== See also ===
[ Links where applicable to interesting use, references (NOT ref) etc. ]

I'll just go ahead and implement the listings using this format, but please tell me if you would like it done differently. --Draicone (talk) 07:44, 3 October 2006 (UTC)Reply[reply]

Minor change - now names of variables and functions are bolded and not their data types. --Draicone (talk) 08:25, 3 October 2006 (UTC)Reply[reply]

Work to doEdit

If anyone is an experienced php dev, please add sections for the 25 functions. You can use my current two as examples. Be simple and to the point if possible, but just do what you can. I'm happy to copyedit where required. --Draicone (talk) 08:36, 3 October 2006 (UTC)Reply[reply]

Some ThoughtsEdit

Do we really need both die and exit on the list, they are exactly the same. Also, i think we should replace print_r for var_dump, and maybe include date and/or time.

Kev 23:49, 9 December 2006 (UTC)Reply[reply]

No particular order?Edit

"Following is the raw list of 25, in no particular order:"
No particular order? They're in alphabetical order! --Daniel15 14:18, 9 January 2007 (UTC)Reply[reply]


Does anyone else think we should fix the style for the examples? Some of the examples use single quotes ('), others use double quotes (", whatever they're called). Some use the K&R indentation style, whereas others use the BSD style. We need to maintain some level of consistancy here :-) --Daniel15 14:27, 9 January 2007 (UTC)Reply[reply]

You should only use double quotes for using the escape things for special characters (\n, \t etc), using single quotes is marginally (talking milliseconds here) faster anyway..... As for the indentation, eh, it's not exactly head scrathing-ly different.
Kev 01:18, 12 January 2007 (UTC)Reply[reply]

Don't get why ceil() is in there.Edit

couldn't you just use modulus?

if($var1%$var2 == 0) {
    echo "$var1 is divisible by $var2";

(The preceding unsigned comment was added by (talkcontribs) 22:44, 17 February 2008)

Return to "PHP/25 Essential Functions" page.