Problems with printing values in foreach.
Posted: Thu May 07, 2009 10:10 am
So I'm working on a script and having immense difficulties using foreach. I've been trying solutions in the manual but to no avail.
Here's the code I'm using and having trouble with:
$this->matches refers to a preg_match_all instance. The problem is, is that whenever I print the value, it says "Array" on the page, instead of the value like it should. Getting rather frustrated and wondering if it's a problem deeper than my coding 
Here's the code I'm using and having trouble with:
Code: Select all
foreach ($this->matches as $page) {
print "$page";
echo "<br />";
}