Getting an array from an include file [Resolved]
Having trouble with some code... see below:
File: template.php
PHP Code:
<?php /* kicks ASP! */
$related = include('page.php');
foreach ($related as $rel_item){
include($rel_item.'.php');
}
?>
File: page.php
PHP Code:
<?php /* kicks ASP! */
$related = array('mediareview','vectornews','latestnews');
return $related;
?>
When I access template.php I recieve the following error:
Quote:
Warning: Invalid argument supplied for foreach() in /home/xvnt/public_html/php_template/template.php on line 4
Anybody know whats wrong?
Thanks for any help,
Phil
P.S. Running PHP 4.3.8 on Apache 1.3.31, if it makes a difference.