I need some guidance with a exercise I was set as part of my PHP class. I've tried many different methods but none that satisfy the requirements. The task is to do the following:
Prerequisite :
- Without using any variation of a loop
- Without any variation of string repeat
- Without string join function
- Without the require statement
Using only 4 lines of code
- It's worth noting that each statement must be on it's own line and the
<?php,?>tags count as one line each.
- It's worth noting that each statement must be on it's own line and the
Output: print the following text 200 times
“All work and no play makes jack a dull boy.”
I'm assuming it requires the use of a while loop but I've exhausted my knowledge of PHP and simply can't come up with a solution. I'm not necessarily looking for the answer just to be pointed in the right direction.
Thank you.
str_repeat()??>in place unless you're writing other (non-PHP) code after the PHP code. So all you need is the<?phpopener, thus you can use three lines....