Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
how should I learn or practise looping in php?
I am a fresher in php and doing a fresher's job in an organisation developing web pages.
I am facing serious problem in looping galleries or other similar contents using while loop. The design are mostly done using tr and td. I always fear of loosing the job or leaving the job. I can not do it neatly without the help of seniors. What should I do? How should I practise? Is my IQ in this regard is poor and I should look for other kind of jobs? Please help me out
6 Answers
- sappy16Lv 48 years agoFavorite Answer
If you want to use a loop to output a table with multiple rows and cells, you need to think before you start coding about where you want the loop to go, and what code needs to go before and after the loop. For outputting the rows, you might have one loop, and then within that loop, you might have another loop to output the cells in each loop. Here is an example:
$cellcontent = "some content to print inside the cells";
for( $i1=0; $i1<5; $i1++ )
{
echo('<tr>');
for( $i2=0; $i2<4; $i2++ )
{
echo('<td>'.$cellcontent.'</td>');
}
echo('</tr>');
}
This will create four rows of three cells each containing the value of your $cellcontent variable.
It just takes some practice and some thought to get it right - keep working on looping problems, give yourself little exercises to do. Tell yourself you will make a loop that creates six rows of five cells each, then go and create it and keep working on it until it works. Once you have the basics down, you can move on and practice making more difficult loops with more complex outputs.
Practice makes perfect, and you will get the hang of it eventually.
- Anonymous8 years ago
How long have you been at that job Surajit?
I'm also a beginner too, 8 months to be exact as web developer/programmer.
For me, you will learn it the more you use or practice it.
Keep giving more effort. Extend your time.
Don't ask for help on the seniors unless you're almost stuck.
by the way, I learned a lot from http://stackoverflow.com/
you can ask questions there instead of asking to the seniors on your company
- Anonymous5 years ago
Yeah - this is incredibly worth it. this is complicated to appreciate in case you do not have some progression history, yet in case you follow the tutorials you'll figure it out. you should acquire the SDK from solar, and then you will be able to easily bypass to Google and type Java Programming Tutorials. you receives thousands of hits.
- How do you think about the answers? You can sign in to vote the answer.
- Ajay DLv 68 years ago
I want to help you. email me at leadlion98 at yahoo dot com. If you wish, you can pay me later. If you don't wish, you need not pay anything.