Contact: aviboots(AT)netvision.net.il
39,873 questions
51,797 answers
573 users
$url = "http://www.website.com/abc/xyz"; $s = substr($url, strrpos($url, '/') + 1); echo $s; /* run: xyz */
$url = "http://www.website.com/abc/xyz"; preg_match("/[^\/]+$/", $url, $matches); $s = $matches[0]; echo $s; /* run: xyz */