Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/02/2012, 12:50
diegoibanez
 
Fecha de Ingreso: agosto-2010
Mensajes: 44
Antigüedad: 13 años, 8 meses
Puntos: 2
Respuesta: Qué anda mal en esta función?

Como ya te dijeron arriba tu sintaxis es inventada, me imagino que lo que quieres hacer es esto, prueba y nos cuentas:

Código PHP:
Ver original
  1. <?php
  2. function rating_convert($rating, $rating_type) {
  3.     $movie_rating = '';
  4.     for ($i=0; $i < $rating ; $i++) {  
  5.             if ($rating_type == 'dedos') {
  6.                     $movie_rating .= '<img src="dedos.png" alt="dedos" />';
  7.             }
  8.             elseif ($rating_type == 'numero') {
  9.                     $movie_rating .= '<img src="numero.png" alt="numero" />';
  10.             }
  11.             else {
  12.                     $movie_rating .= '<img src="estrellas.png" alt="estrellas" />';
  13.             }
  14.         }
  15.         return $movie_rating;
  16.     }
  17. ?>