View Full Version : Php + -

10-16-2009, 05:29 PM
Hi, quick post, im just tryna figure out how to plus and subtract etc using php.

cant find any tutorials.

for example heres what i want to do




<? echo "$magicnumber" ?>

just wondering if any body knows of a tutuorial or could show me how that should be set out.

would be appreciated.

thanks Allot in advance


10-16-2009, 05:36 PM
What you're doing is OK, but the variables must be the same (caps and small letters).
You have one all caps, the other all small ... which is incorrect.

To increment the variable, both of these produce the same result:

$magicnumber = $magicnumber + 1;

Pay attention to case-sensitivity ... your variables.

Not all webhosts are set-up the same for PHP, in regards to <?

You may be able to do this ...
// code

or you may have to do this ...
// code

10-16-2009, 05:55 PM

i know that php is usually case sensitive, i just missed the fact id wrote one in caps and one without, i must have had caps on for some other reason.

i knew that could be done, and assume that's how i should do it, but when it didnt work i just assumed id done it wrong and couldnt find a tutorial

again, thanks for your help :)


10-16-2009, 06:24 PM
this is great to start off http://www.tizag.com/phpT/