Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/01/2003, 00:32
Avatar de cvander
cvander
Moderador
 
Fecha de Ingreso: abril-2001
Ubicación: Ciudadano del mundo
Mensajes: 13.638
Antigüedad: 23 años
Puntos: 1792
Gracias, ya tengo lo que necesito:

Código PHP:
The code below is an alternative to the basename() function in PHP, and it is here to illustrate the use of the substr() function. 

/******************************************** 
  Getting the file name from an address 
like [url]http://www.xpto12345.xyz/abc/def/ghi.php[/url] 
            using substr() function 
********************************************/ 

// This procedure only works when the filename 
// is at the end of the string 

$fn="abc/def/ghi/jkl.php"// 'where is the filename' string 

$a strlen("$fn"); 

while (
$a>0){ 
if(
substr(substr($fn$astrlen($fn)), 01)=="/"){break;} 
 
$b=substr($fn$astrlen($fn)); 
$a=$a-1


print 
$b
__________________
- Christian Van Der Henst
Platzi