<?php $link = 'site.ru/alias/path/cut-me';echo pathinfo($link)['filename'];
Standard input is empty
cut-me
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!