<?php $opa = array(); preg_match('/[^\\\\]*\.(\w+)$/', "Arquivo/tal/file.jpg", $opa); print_r($opa);?>
Standard input is empty
Array ( [0] => Arquivo/tal/file.jpg [1] => jpg )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!