Php For

free web hosting
Open Discussion > CONTRIBUTE > The Internet > Web Design

Php For

Tom743
Ive got this small php script that makes the numbers count up.

CODE
<?php
for($num = 1; $num <= 10; $num++) {
echo "Number: $num<br>";
}
?>


Is there any way it can be changed so that the numbers count down?

Thanks

Reply

rvalkass
Change ++ to -- and switch the numbers round:

CODE
<?php
for($num = 10; $num >= 1; $num--) {
echo "Number: $num<br>";
}
?>

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics
Looking for php

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for php

*MORE FROM TRAP17.COM*
advertisement



Php For



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE