Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:26 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PHP exercises
PostPosted: Thu Oct 05, 2006 10:09 am 

Points:
Hey guys, let's put this forum moving!

The other day I got myself searching for php exercises, and look! I couldn't find almost anything so how about everybody post here some php exercises?

I'll post the ones that i found.

1? Do the (I don't know what is called, that 3*1=3, 3*2=6....until 10...you know) with only 3 lines of code and 1 variable.

2? With the same rules do a list of the pair numbers until 100.

Good work, and don't post the answers here. Any question PM me!


Report this post
Top
  
Reply with quote  
 Post subject: Shortest Loops
PostPosted: Fri Nov 03, 2006 8:19 pm 

Points:
What is the shortest loop of each type of Control Structure that when run will go on until the PHP limit (something like 3 minutes) is reached?

For example:

[php]<?php
$x=0;
while(1) {
echo $x;
$x++;
}
?>[/php]

Will run forever (until PHP limit cuts it off), always printing out something while still changing. However, there are faster and shorter ways to do this... :P

The loops have to meet these requirements:

1) Run "forever".
2) Send something to the screen on each run.
3) Change any values stored or echoed on each run.


Make one of each kind:

Code:
for
while
if
else
elseif
do while
switch
foreach


This link will help you


If you think you can make the fastest loop, go ahead and post it. Maybe someone else made it faster...


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]