notooth Posted May 26, 2005 Share Posted May 26, 2005 I have about 40 varibles declared in file var.php:<?$a[0][0]=1;$a[0][1]=2;..............$t[1][1]=26;?>and below is the code from file index.php that has problem:<?require 'var.php';?>......some code.....<?echo 'a = ' . $a[0][0];?>......some code....<?echo 'a = ' . $a[0][0];?>The problem is: I did not change any value of the variables, but some variables $a[0][0] at the bottom of index.php displayed nothing on the page . Can you help me with that? Link to comment Share on other sites More sharing options...
notooth Posted May 29, 2005 Author Share Posted May 29, 2005 Can anyone help? Link to comment Share on other sites More sharing options...
eXPerience-XP Posted May 30, 2005 Share Posted May 30, 2005 on both pages try putting global $a; and then tell me if it works Link to comment Share on other sites More sharing options...
notooth Posted May 30, 2005 Author Share Posted May 30, 2005 on both pages try putting global $a; and then tell me if it works<{POST_SNAPBACK}>It doesn't work either . Link to comment Share on other sites More sharing options...
notooth Posted May 30, 2005 Author Share Posted May 30, 2005 This is the weirdest thing:<?$a[0][0]=1;?>..................................<?echo "a = " . $a[0][0];?>................................<?echo "a = " . $a[0][0];?>the result is:a = 1a =I got nothing for $a[0][0] at the bottom of the page . Link to comment Share on other sites More sharing options...
eXPerience-XP Posted May 31, 2005 Share Posted May 31, 2005 maybe the value of a is changed between the first echo and the second echo. Link to comment Share on other sites More sharing options...
notooth Posted May 31, 2005 Author Share Posted May 31, 2005 I fixed the problem by changing $a to $aa.Thanks eXPerience-XP for your help . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now