[pmwiki-users] php question

Patrick R. Michaud pmichaud at pobox.com
Wed Feb 6 19:55:11 CST 2008


On Wed, Feb 06, 2008 at 10:36:05PM +0100, noskule wrote:
> hi list
> what is the best way to say in php: Remove everything after the last
> slash (including the slash)

    $x = preg_replace('!/[^/]*$!', '', $x);

If there's no last slash, nothing gets removed.

Pm




More information about the pmwiki-users mailing list