What is the java linkedhashmap equivalent in php? Array? Need a good example with keys.

Anyone can give a good example of a linkedhashmap equivalent in php?

Need a good example with keys.
glyncoAsked:
Who is Participating?
 
glyncoAuthor Commented:
foreach ($articles['Article'] as $my_object)
{
    $title = (string)$my_object->title;
    $my_associative_array[$title] = $my_object;
}
0
 
Beverley PortlockCommented:
There is nothing explicitly like Java's linked hash tables - PHP arrays are just simple associative arrays. PHP 5 does have a standard library that may get yu some way towards your goal. See http://uk3.php.net/spl and perhaps one of the HEAP classes.

Maybe a more pertinent question is why you would need such a structure in the first place? PHP is not performance oriented in the same way Java is because with PHP running on a server with almost no user interaction (compared to a GUI) there is little need for such complexity.
0
 
glyncoAuthor Commented:
This is what close to linkedhashmap with key and the objects in each key.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.