Talk:PHP/25 Essential Functions

From Wikiversity
Jump to navigation Jump to search

Format[edit source]

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

== [ http://php.net/Functionname 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 php.net 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]

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

Work to do[edit source]

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]

Some Thoughts[edit source]

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]

No particular order?[edit source]

"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]

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]

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]

Don't get why ceil() is in there.[edit source]

couldn't you just use modulus?

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

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