25/05/2005, 07:51
|
| | | Fecha de Ingreso: agosto-2004 Ubicación: Madrid, España
Mensajes: 280
Antigüedad: 19 años, 8 meses Puntos: 1 | |
Con la función strrpos: Código PHP: $i = strrpos(substr($path, 0, strlen($path)-1), "/"); // El índice del último / $var2 = substr(substr($path, 0, strlen($path)-1), i); // Pongo strlen()-1 para evitar el último / del final del todo O bien así: Código PHP: $vars = explode($path, "/"); $var2 = $vars[count($vars)-1); http://es2.php.net/manual/es/function.explode.php http://es2.php.net/manual/es/function.strrpos.php |