I have a URL cleaned up to look like this:
/foo/bar
I tried this:
preg_match('#([a-zA-z0-9]+)#', $path, $matches);
But $matches is output as:
Array
(
[0] => /foo
[1] => foo
)
What regex can be used (i.e. with preg_match()
) to get foo
and bar
?