<? $currentFile = $_SERVER["SCRIPT_NAME"]; $img = array_pop(explode("/", $currentFile)); echo $img; ?>