So I have $x = 2; But I added $x-1; it wont subtract 1 from the variable. Can someone help me here. Am I doing this wrong?
If you're always looking to subtract just 1, you can use --. $variable = 5; $variable = $variable--; //Now 4 $variable = $variable - 1; //Also 4
For some strange reason I have $x=2 at the top and I put in a certain area: $x= $x-1; and it doesnt subtract 1
Then you have done something else wrong. Why not post all the code? Or, in the privacy of your own home, simply stick in a bunch of: echo "<p>x is now {$x}</p>"; throughout the code and then watch the progress of $x to see where it diverges from your expectations.
at the top I have <? $x = 2; INCLUDES.... ?> Then I have a function and in that function it will display text $x = $x -1; echo "fiefieh" It shows fiefieh at the footer I have <?=$x?> and it shows 2 whats wrong