I am trying to parse the php script to print contents of config file.
bar.php:
<?php
$arr = array("monday", "tuesday");
?>
mainscript.php:
<?php
function foo(){ # define function
$today = date('Y-m-d');
require_once( "bar.php" );
foreach ($arr as $value)
{
$foo = $value.$today ;
echo $foo ;
}
}
foo(); # function call
?>
This is what I get:
php mainscript.php
monday2015-03-25tuesday2015-03-25
This is what I want:
monday2015-03-25
tuesday2015-03-25