Variable disaper
Posted: Thu Jan 21, 2010 3:36 am
In the script below I cannot figure out why my $test_array is gone after line 16
Please give me a hint to solve this problem
Please give me a hint to solve this problem
Code: Select all
<?php
$test_array = array(1,2,3,4);
// Here I can see the $test_array
echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="testing">';
// echo "<select name='test'>";
print_r($test_array); Display: Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 )
echo "<br>";
echo "<br>";
// Here I cannot see the $test_array
echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="testing">';
echo "<select name='test'>";
print_r($test_array); Display: Nothing
?>