I want to parse a URL and add each of its subpaths as an element in an array.
For example :
http://www.abcd.com/efgh/ijkl/mnop.php
for this URL the array will look like:
[
'http://www.abcd.com',
'http://www.abcd.com/efgh',
'http://www.abcd.com/efgh/ijkl',
'http://www.abcd.com/efgh/ijkl/mnop.php'
]
The problem is I am unable to add the exploded path to previous paths.
explode("/",parse_url($url, PHP_URL_PATH))
parse_url($url, PHP_URL_PATH)and add it accordingly @bugscoder