Have an account? Sign in
Login  Register  Facebook
a simple question
I have some users listed below in an order:

user1
user2
user3
user4
user5

This is just a simple list, sorted according to age.

Now a new user (user6) comes in, and according to the sorting, he fits after user 2, so the order becomes like:

user1
user2
user6
user3
user4
user5

Now I want to know at which position it is. For example it is on place3.
How can i find its position when a new user comes in the list??
Please tell any general way?
there is no any database etc, just a logic question.
Started: September 19, 2011 Latest Activity: September 19, 2011 logic
1 Answer
What does this have to do with MySQL?
Use
array_search($myuser, $users);

See array_search.

Posted: MacOS
In: September 19, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer