Skip to content

Instantly share code, notes, and snippets.

@Tocacar
Created July 10, 2012 08:04
Show Gist options
  • Select an option

  • Save Tocacar/3081951 to your computer and use it in GitHub Desktop.

Select an option

Save Tocacar/3081951 to your computer and use it in GitHub Desktop.
<?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