Contact: aviboots(AT)netvision.net.il
31,051 questions
40,769 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 */