function pokemon1()
{
include 'details.php';
$path = $_SESSION['path'];
$health = $_SESSION['health'];
echo "<br />";
echo $path;
echo "<br />";
echo $health;
}
function pokemon2()
{
include 'details.php';
$flag = $_SESSION['flag'];
$damage = $_POST['attack'];
$oppo_health = $_SESSION['oppo_health'];
$oppo_path = $_SESSION['path'];
echo "<br />";
echo $oppo_path;
echo "<br />";
$oppo_health = $oppo_health - $damage;
echo $oppo_health;
$_SESSION['attack'] = $damage;
$_SESSION['oppo_health'] = $oppo_health;
}
How can I use the $path variable of function pokemon1() in function pokemon2()??? I tried declaring outsite the function with "global" but still its showing undefined!