wordpress How to add post title in link

I am using adcenter ads, which are as-


Now i want to replace Keyword in link with post title automatically. i have tried this code, but it return first word from title, code is-

 $title = get_the_title();
 echo "<a href=http://ads.ad-center-com/offer?prod=101&ref=5030200&q=$title >Download</a>"

please solve it or tell me other method to add title in link automatically.

Source: wordpress

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.