meaning of this php code?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeevanism
Forum Newbie
Posts: 14
Joined: Fri Dec 09, 2011 12:12 am

meaning of this php code?

Post 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;
}
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: meaning of this php code?

Post 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.
jeevanism
Forum Newbie
Posts: 14
Joined: Fri Dec 09, 2011 12:12 am

Re: meaning of this php code?

Post by jeevanism »

thanx a lot for your explanation
Post Reply