Jump to content

array help


iarnazca

Recommended Posts

Have you checked, what max() function returns? It returns the maximum value, not the index of this value in the array, so the conclusion is simple: you have to find another way. Have you thought of writing the maximum value searching algorithm yourself, so that you could program it to find the index, too. I won't give you a ready code - try to write it yourself. It's very easy: just scan the array, store the current maximum value in some extra variable and if you find a greater one, update it. At the same time, remember the index in another variable and that's all.

Link to comment
https://forums.phpfreaks.com/topic/192709-array-help/#findComment-1015167
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.