Can’t get full post title if there a spaces in title

Damn, I came with a solution after I posted it….

echo ' <a href="http://www.bing.com/search?q=' . urlencode($titletest) . '">' . $titletest . '</a>';