Ans: Get a first value of dynamically generated array in php.
following is the array:

array(5=>90,7=>80);

Array(
  [5]=>90
  [7]=>80
)

$myarr=array(5=>90,7=>80);
$arrKeys=array_keys($myarr);

// the first element of your array is:

echo $myarr[$arrKeys[0]];

Written by
Check out this Author's contributed articles.
If you like Tutorialsmint and would like to contribute, you can also write an article using Write an Article. See your article appearing on the Tutorialsmint main page and help other programmers to enhance their knowledge.

Comments(0)

RECENT TUTORIALS
Wed Dec 26 • 08:00 AM GMT
Wed Dec 26 • 08:00 AM GMT
Wed Dec 26 • 08:00 AM GMT
Wed Dec 26 • 08:00 AM GMT
Wed Dec 26 • 08:00 AM GMT
Edit Post
Add Reply