D7 - Whitespace before printed fields How to get rid of the whitespace in printed fields?

Here's my source code in node.tpl:

&lt;div class="banner" style="background-image:url('&lt;?php print render($content['page_banner']); ?&gt;');"&gt;


And here's the result (whitespace before http://)

&lt;div class="banner" style="background-image:url('  http://localhost/files/styles/1180x300/public/banners/test.jpg?itok=5LPh1ZdQ');"&gt;
&lt;/div&gt;


Any ideas?
Have you tried adding a trim() ? Like :

&lt;div class="banner" style="background-image:url('&lt;?php print trim(render($content['page_banner'])); ?&gt;');


It should just do the trick...

Beyond that, whatever is generating the $content['page_banner'] content is probably adding the unnecessary spaces.