Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/06/2011, 03:41
Avatar de repara2
repara2
 
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: Aplicar path en base al .php mostrado

Tu soluci´on es correcta, aunque yo usaria:



Código PHP:
Ver original
  1. <?php
  2.  
  3. $url = "http://midominio.com/elproyecto/info.php";
  4. $file = "humans.txt";
  5.  
  6. function setHumans ($param, $file)
  7. {    
  8.     $url = explode('/', $param);
  9.     $pag = $url[count($url)-1];
  10.     $pth = explode($pag, $param);
  11.    
  12.     return $pth[0].$file;
  13. }
  14.  
  15. echo setHumans($url, $file);
  16. ?>
__________________
Fere libenter homines, id quod volunt, credunt.