PHP
Diary of a late, late adopter
Thursday, March 27, 2003

Stupid PHP function of the day:  current();  returns the value of the current element of an array.  Except if the element is empty or null or zero then it returns false.?$%&$  Also, if you add an element to an array, current() will never get the last element added.  It will return the second to last value unless you issue the end() command on the array.

current() has a sister function called key() which returns the key instead of the value and has the same issues with adding an extra element.

Hmmm.


9:39:56 PM    comment []





© 2003 mcgyver5
Last Update: 8/14/2003; 1:38:00 AM

Click here to visit the Radio UserLand website.

 











March 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Nov   Apr

Subscribe to "PHP" in Radio UserLand.
Click to see the XML version of this web page.
Click here to send an email to the editor of this weblog.