Forum Moderators: coopster
so explode your PATH_INFO - i.e. separate it into an array splitting it at the character you specify:
$new_array = explode("/", $PATH_INFO);
this gives you an array with three variables
$new_array[0] is empty (the bit to the left of the first slash don't ask why ;-)
$new_array[1] is 'dir1'
$new_array[2] is filename.php
then strip off the last 4 characters (.php) of $new_array[2] to leave just 'filename':
$filename = substr($new_array[2], 0, -4);
<added> that's much quicker johannes, - cheers :-))
allthough would have to substr to remove the .php