Usually in my PHP apps I have a base URL setup so I can do things like this
tom/jones\">Tom
Yes, you can use get_bloginfo('url') just like that or define a constant...
get_bloginfo('url')
define('BASE_URL', get_bloginfo('url'));
If you are working on a template and want the URL fragment to that theme folder, use...
bloginfo('template_directory');