Hi all,i tried to do some research regarding associated arrays in php,even manual on the php documentations,but can not find the answer,how do i print the smallest value and the associated key from the array?
LibraryCode 0
Junior Poster in Training
Recommended Answers
Jump to PostQuick n dirty:
$array = ['me'=>10,'you'=>9, 'them'=>33]; asort($array); $key = key($array); $val = $array[$key]; echo "The key is '$key' and the value is '$val'";
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.