r/code • u/AndreasSkole • Nov 18 '19
Need some simple PHP coding explained.
So we (my class) is getting started with PHP coding and were given the task to write a program that would write the following text:
(Watch image)

For most of you this is going to be easy, but I have no clue where to begin. So i checked what the final answer is supposed to be:
<?php $rowNumber = 10; while( $rowNumber > 0 ) { $columnNumber = 0; while ( $columnNumber < $rowNumber ) { echo "\*"; $columnNumber++; } echo "\\n"; $rowNumber--; }?>
I just don't understand how I'm supposed to see this. Anyone got any advice for how I can practice these kinds of tasks?
0
Upvotes
4
u/4gotn1 Nov 18 '19
Literally? There are online sandboxes if you need to test it out.
Or do you need someone to explain it step-by-step?
Perform them multiple times. Find idea blogs (etc) online like Rosetta Code and Project Euler.