You are here: Adding to a numeric variable, how? « PHP « IT news, forums, messages
Adding to a numeric variable, how?

Posted by Dotan Cohen on 11/05/05 13:23

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация