I need to parse a URL into an array and was having some difficulties figuring out how to do it properly. It’s a bit complicated.
So my URL would be something like this:
http://sharepoint/webname/libraryname/subfolder1/subfolder2/subfolder3/documentname
And the results would need to be like so
array0 - http://sharepoint
array1 - webname
array2 - libraryname
array3 - subfolder1/subfolder2/subfolder3
array4 - documentname
I would appreciate any guidance.
This works for me:
I get this result: