[ 3 posts ] 
Author Message
 Post: #1 | Post subject: New in learning PHP
PostPosted: Sun Jan 15, 2012 11:26 am 
Major eBook Releaser
User avatar

Posts: 1063
Location: S€RB|@
WRZ$: 14763.00

Device: MioKnightRider
Hello to all, i hope someone can help me, because i know our forum is great:

Hello to all mates, i am new in learning PHP and it has passed 2 weeks of my learning.
I have read many posts here on forum, and i was very fond of this, it helped me to understant the basic core and i hope i will put my learning on my bigeer level.
And now i have try to make a self some good taskt to keep self undertanding PHP, here is the one task i have made for myself, and there i got a problem, i can not make it, i have trying and trying, but no result, then i need help.
Here is my code:

<?php
$x=20;
$y=20;
for($i=0;$i<$y;$i++)
{
for($u=0;$u<$x;$u++)
{
if ($u<$x-1 && $i<$y-1 && $i<$u && $i>0)
echo "5";
else if($u>0 && $u<$x-1 && $i>0 && $i<$y-1)
echo "2";
else
echo "3";
}
echo "<br />";
}
?>


When i do this i got the result:

33333333333333333333
32555555555555555553
32255555555555555553
32225555555555555553
32222555555555555553
32222255555555555553
32222225555555555553
32222222555555555553
32222222255555555553
32222222225555555553
32222222222555555553
32222222222255555553
32222222222225555553
32222222222222555553
32222222222222255553
32222222222222225553
32222222222222222553
32222222222222222253
32222222222222222223
33333333333333333333

This me for learing the "for" command, everything is ok, but i really want he result to look like this:

33333333333333333333
32555555555555555553
35255555555555555553
35525555555555555553
35552555555555555553
35555255555555555553
35555525555555555553
35555552555555555553
35555555255555555553
35555555525555555553
35555555552555555553
35555555555255555553
35555555555525555553
35555555555552555553
35555555555555255553
35555555555555525553
35555555555555552553
35555555555555555253
35555555555555555523
33333333333333333333

Only number "2" on diagonale.I have tried many ways, but i got no results, can somebody help me with the code, where i go wrong, and what i need to add??
Thanks on yours fast answers, i hope soon with yours help i will do better, txanks

_________________
Image
If you like my work, and want to keep me going to upload new releases, download this small file:
High Speed Connection:
http://rapidshare.com/files/352701103/ThankYou
Low Speed Connection:
http://rapidshare.com/files/340569064/ThankYou.txt
Image
Image
Image




Top
 Offline Profile  
 
 Post: Advertisement
PostPosted: Sun Jan 15, 2012 11:26 am 
The Advertiser

Posts:
Location: Mobilism

 
Top
  
 
 Post: #2 | Post subject: generic proscar
PostPosted: Mon Jan 16, 2012 11:20 am 

Posts: 1
Location: Croatia
WRZ$: 50.10

Device: Not Specified
I have tried proscar before and must say that generic clomid causes less side effects though. I had terrible headache with Viagra which made sex impossible sometimes. With cialis I forgot about it. I would recommend it to anybody who has similar problems and this drug is above all praises.”




Last edited by Managainst on Sun Jan 22, 2012 11:51 pm, edited 1 time in total.

Top
 Offline Profile  
 
 Post: #3 | Post subject: Re: -- .
PostPosted: Mon Jan 16, 2012 11:32 am 
Major eBook Releaser
User avatar

Posts: 1063
Location: S€RB|@
WRZ$: 14763.00

Device: MioKnightRider
Managainst wrote:
you are best ;)


Good comment, but no help :))

_________________
Image
If you like my work, and want to keep me going to upload new releases, download this small file:
High Speed Connection:
http://rapidshare.com/files/352701103/ThankYou
Low Speed Connection:
http://rapidshare.com/files/340569064/ThankYou.txt
Image
Image
Image




Top
 Offline Profile  
 
 [ 3 posts ] 

All times are UTC





All content © 2006-2013 Mobilism. Contact us | Privacy policy | Terms & conditions | Copyright policy
Powered by ServerBlast and phpBB © 2000, 2002, 2005, 2007 phpBB Group