Hi, im trying to figure out how i could accomplish this.
$string = 'http://www.domain.com/dir1/3';
I need to chop off the /3 at the end, but ive failed to do this b/c its also taking the 1 out of dir1. I just need to always take off the last characters of the string.
It could be /3234 one day, and ill still need it to only take off those
What im having trouble in is only matching the last /whatever number, and not taking it off the entire string.
So
$string = 'http://www.domain.com/dir1/3';
Becomes
$string = 'http://www.domain.com/dir1/';
$string = 'http://www.domain.com/whatever/323322342';
becomes
$string = 'http://www.domain.com/whatever/';