Jump to content

Variables In Array?


Recommended Posts

On a webpage I have an array which is filled with variables such as:

$wprearray = array ("$wcomment","$wcgd", "$wcmf", "$wcmp");

Now these variables are defined elsewhere in the page so when they are placed into the array they will contain a value. With this array I will then add to the values already placed inside. EG. $wprearray[2] = $wprearray[2] + 5;Now if $wprearray[2] had an original value of 2, then after this it should have a value of 7. But that is not the case. The final value is displayed as 5. What is wrong here?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...