how to limit the values in array variable? – PHP

  php

Q(Question):

hi
In my code i have sorted the high_score
through this
arsort($highscore_user);
// $highscore_user is associated array(i.e. id=>score)
Now i want limit it ,say 10 sorted array value of it.
How to do it

Regards
Sid

A(Answer):

try this

A(Answer):

hey johny i just want to remove excess value from this $highscore_user.

A(Answer):

copy to another array

A(Answer):

hi johny i got sorted out.
Can help me in this,Can i send array value like
$lang=array(‘Programmer’, ‘Senior Programmer’, and so on…)
to this

SELECT f_name, l_name, title from
employee_data where title IN
(___________Some what here $lang_____________);

instead of this way

SELECT f_name, l_name, title from
employee_data where title IN
(‘Programmer’, ‘Senior Programmer’,
‘Multimedia Programmer’);

bz $lang varies constantly

A(Answer):

certainly you can just check foreach iterator. you will get the idea properly.

its simple

A(Answer):

i know to use foreach loop but its not the efficient(mean its takes more time) way to do query so i ask other way round

LEAVE A COMMENT