<?php preg_match('!/([^/]+)/[^/]*$!', 'http://w...content-available-to-author-only...w.example/test1/test2/test3/', $matches);echo $matches[1]; ?>
Standard input is empty
test3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!