Use basename instead of strrpos