?
Solved

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

Posted on 2012-03-13
3
Medium Priority
?
580 Views
Last Modified: 2012-03-18
Anyone can give a good example of a linkedhashmap equivalent in php?

Need a good example with keys.
0
Comment
Question by:glynco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 37713560
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
 

Accepted Solution

by:
glynco earned 0 total points
ID: 37715185
foreach ($articles['Article'] as $my_object)
{
    $title = (string)$my_object->title;
    $my_associative_array[$title] = $my_object;
}
0
 

Author Closing Comment

by:glynco
ID: 37734356
This is what close to linkedhashmap with key and the objects in each key.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question