@
You are correct that isnt the result I would want.
the variable $url only relates to the main URL = http://www.example.com.
The only reason it would change is whether it was in my dev environment or not = http://test.com
I guess I am just ensuring that the files always resolve to the correct place without any hard coding. So something like this:
/include
/js
/css
images/home
images/anotherfolder
Will always know what the base URL is.
I apologise if I am talking in riddles, my terminology experience is not great as yet. But I hope you are understand me?