Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/01/2004, 03:31
jmaribau
 
Fecha de Ingreso: enero-2004
Mensajes: 235
Antigüedad: 20 años, 2 meses
Puntos: 0
Escojer 1 opcion entre 5

Estos 5 trozos de código són equivalentes. Qual es el más correcto? y pq?
Código PHP:
1.      unset($imgsrc);
        
$imgsrc[] = $_SERVER['PHP_SELF'].'?';
        
$imgsrc[] = 'm=1';
        
$imgsrc[] = 'src='.$path_fichero;
        
$imgsrc[] = 'w='.$newsize[0];
        
$imgsrc[] = 'h='.$newsize[1];
        
$imgsrc   implode('&'$imgsrc);

2.      $imgsrc "$_SERVER[PHP_SELF]?&m=1&src=$path_fichero&w=$newsize[0]&h=$newsize[1]";
        
3.      $imgsrc $_SERVER['PHP_SELF'].'?&m=1&src='.$path_fichero.'&w='.$newsize[0].'&h='.$newsize[1]; 

4.      $imgsrc  $_SERVER['PHP_SELF'].'?';
        
$imgsrc .= '&m=1';
        
$imgsrc .= '&src='.$path_fichero;
        
$imgsrc .= '&w='.$newsize[0];
        
$imgsrc .= '&h='.$newsize[1]; 
        
5.      $imgsrc  "$_SERVER[PHP_SELF]?";
        
$imgsrc .= "&m=1";
        
$imgsrc .= "&src=$path_fichero";
        
$imgsrc .= "&w=$newsize[0]";
        
$imgsrc .= "&h=$newsize[1]"
Un saludo