I've a week off work so I'm keeping busy trying to learn php.
I want to check the contents of my array by printing out whats contrained in them.
foreach ($articleList as $item)
{
$this->articles[] = array(
'url' => $this->domain . $item->getElementsByTagName('a')->item(0)->getAttribute('href'),
'title' => $item->getElementsByTagName('a')->item(0)->nodeValue,
// 'author' => $item->getElementsByTagName('em')->item(0)->getElementsByTagName('a')->item(0)->nodeValue,
'description' => $item->getElementsByTagName('div')->item(0)->nodeValue,
'article' => ''
);
}
foreach ($this->articles as $x)
{
echo $x;
}
The code at the bottom is where I am trying to print out each piece of the array and see what contents it holds, So i can understand what the code above it is doing.
But its just blank even though the array size is 30.
How can I go about doing this?
Many Thanks, -Code