Page 1 of 1

meaning of this php code?

Posted: Sat Jan 28, 2012 3:30 am
by jeevanism
I am so sorry for being so dumb. but what is the meaning of this code snippet?

Code: Select all

function DateCmpExtra($a, $b) {
    return ($a[1] < $b[1]) ? -1 : 0;
}

Re: meaning of this php code?

Posted: Sat Jan 28, 2012 7:45 am
by Celauran
It compares the second elements from the arrays $a and $b, or the second character if $a and $b are strings, and returns -1 if the element/character in $a is less than the element/character in $b, or returns 0 otherwise.

Re: meaning of this php code?

Posted: Sun Jan 29, 2012 12:32 am
by jeevanism
thanx a lot for your explanation