Lets say I am configuring a module’s $basePath property in
If I use the dirname() function to get the script’s path and calculate the path to the images folder, I get something like this -
But instead I would like -
so that I can replace the common part
to get the corresponding Url. Is there a way to do that? To be honest, I have never used regex before, so if there is a regex, please post it here.