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;
}
如何在函數pokemon2()中使用函數pokemon1()的$ path變量? 我試過用「global」聲明outsite函數,但仍然顯示undefined!如何在另一個函數中使用變量php
這是怎麼回事[標籤:MySQL] ...? – webeno