Created
July 10, 2012 08:04
-
-
Save Tocacar/3081951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Write a function that generates a | |
| * random 5 star rating as a decimal | |
| * number and outputs the following | |
| * strings (in place of star images) | |
| * | |
| * 'Full Star', | |
| * 'Partial Star', | |
| * 'Empty Star' | |
| * | |
| * in a row, as required, to | |
| * represent the generated rating. | |
| * | |
| * For example, for a 3.2 rating, | |
| * the correct output will be: | |
| * | |
| * Full Star Full Star Full Star Partial Star Empty Star | |
| * | |
| * ADDITIONAL: | |
| * | |
| * If you know HTML, output <img> | |
| * tags instead of strings, using | |
| * the star images provided in the | |
| * assets directory. | |
| * | |
| * SOLUTION: | |
| * | |
| * See L3_RatingSolution.php for | |
| * a solution to this exercise. | |
| * | |
| */ | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment