<?php $path = $_SERVER['REQUEST_URI']; $path = rtrim($path, "/"); $id = basename($path); echo $id; ?>