Let me first start by saying I don't understand Reg-Ex much so I'm hoping someone can help me.
I have a string such as "/1/3" or maybe "/1/34/2/6" and I am trying to get the last number after the final /
A friend sent me this formula but all it give me is the last /
preg_replace('~^/([0-9]+)(/.*)?$~', '$1', $cat['path']);
Where $cat[path] is the string I've got. How should I change this to give me the final number and not the slash /
?