Jump to content

[SOLVED] How to get first key and value from array?


t_machine

Recommended Posts

Hi, I am wondering if anyone can help with this problem.

I would like to get only the first key and value from my array.

 

Example

$myarray = array('linkname1'=>'linkurl', 'linkname2'=>'linkurl2', 'linkname3'=>'linkurl3');

 

What I would like is to get only the first "linkname1" and "linkurl"

It will be use in my codes -> <a href="linkurl">linkname1</a>

 

Thanks for any help :)

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.