Ver original$pedazos = explode("/", $ruta);$ultimo = $pedazos[count($pedazos - 1)];// o$ultimo = array_pop($pedazos);