modified foreach.php so that it echos the value for items that are scalar