Requirements: There are the following array $arr, the array has two modules a net one login, how can I get the last marks according to the net module,
The net module and the login module data is a $arr, net module may also be find add up del Chark or more fields,
No matter how much he's plugged in, I'll come up and I can find the last marks, if you find the last marks under Del, if I don't know del is the one after the group, if I know, I'll make an index, and a foreach, do not traverse, traverse speed is unpleasant, Who's going to give it a little speed?
$arr = Array ("net" = = Array ("find" = = Array ( "marks" = "1234", "name" = "Lisi"), "add" = = Array (" Marks "+", "name" and "Lisi2", "up" + = Array ("Marks" and "+", "name" = "Lisi3"), "Del" and "=" Array ("Marks" = "9", "name" = "Lisi4") , "Login" = = Array (" find" = = Array ("Marks" and "=" 16661 "," name "=" Lisi5 "), " add "= = Array (" Marks "and" 18881 "," Name "and" Lisi6 ")) ;
Reply to discussion (solution)
$v = End ($arr [' net ']), $k = key ($arr [' net ']), echo $k;p rint_r ($v);
Upstairs is awesome hehe
Study the
Really give, study