Quick PHP echo help

What is wrong with this?

echo '<a title="Last Chance" href="'.the_permalink().'" class="status open">Last Chance</a>';

As it’s putting the the_permalink() before the <a instead of inside it.

Related posts

Leave a Reply

4 comments

  1. Actually it looks good to me (but see my edit comment).

    Better is to embed PHP into HTML:

    <a title="Last Chance" href="<?php the_permalink(); ?>" class="status open">
       Last Chance
    </a>
    

    Edit: As @Marwelln found out, the_permalink() is already echoing data. Still, this is a better solution than echoing the HTML.