I've got a URL as a string, for example:
http://example.com/sub/sub2/hello/
I'd like to add another subfolder to it with PHP, before hello, so it should look like this:
http://example.com/sub/sub2/sub3/hello/
I thought about using explode to separate the URL by slashes, and adding another one before the last one, but I'm pretty sure I over complicate it. Is there an easier way?
hello) in the easiest way possible. Sorry if it wasn't clear.