hey guys,
<?php urlencode(the_title()); ?>
doesn’t take effect.
this is my entrie line of code:
<li><a href="mailto:?subject=<?php urlencode(the_title()); ?>&body=<?php the_permalink(); ?>">e-mail</a></li>
I don’t want to have spaces in the_title(). Why does urlencode not work for me?
The
the_title()
echo the title. You must useget_the_title()
instead. get_the_title() returns the title as string. Use