Adding to a numeric variable, how?
| From: | Dotan Cohen | Date: | Sat, 05 Nov 2005 11:23:01 +0000 |
| Subject: | Adding to a numeric variable, how? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-225150@lists.php.net to get a copy of this message | ||
I have a number that I need to display, and itself plus 2:
<?php
$number=23;
$new_number=$number+2;
print $number." ".$new_number."\n";
?>
//
23 25
//
How can I shorten it to something like this:
<?php
print $number." ".$number+2."\n";
?>
Obviously, the above code doesn't do what I want, but I think that it
describes what I need! Thanks in advance.
Dotan Cohen
http://song-lirics.com/sl/artist/498/violent-femmes-lirics.php