0

i'm using Simple HTML DOM Parser to receive certain info that i require, but it seems like the parser outputs the 1st. item it finds. I'm using this code:

$html = file_get_html("http://steamcommunity.com/id/" . $username . "/wishlist/");
foreach($html->find('.wishlistRow') as $e)
{
$item = $e->outertext;
}
echo $item;

this outputs the 2nd item on the wishlist, but not the first. This also applies to other projects i'm working on, and i would really appreciate any help I can get!

Mats Bakken
  • 155
  • 1
  • 14

1 Answers1

2

echo is out of the foreach, so it will only output the last item. Move it inside foreach.

jprofitt
  • 10,874
  • 4
  • 36
  • 46
Tearsdontfalls
  • 767
  • 2
  • 13
  • 32