Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ALL:

Can you help me on if I have an array like:

$mean_array[$elements[$x]["priority_level"]][]=$elements[$x];

everytime it will increase when I want to store sth in it

how can I find the last number..as I know if no key is specified, the maximum of the existing integer indices is taken, and the new key will be that maximum value plus 1...so how should I find the last value?
Posted

1 solution

You will be able to get the last value from the End function.[^]. End will move to the last index in the array and you will be able to get the value. The index can be retrieved from each().

Cheers.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900