如何在PHP中返回字符串时包含变量?

I created a function that returns custom excerpts for a Wordpress template. When returning that function, I want to include a "Read more" linking to the original article but can't get it to work.

When I return $link itself, I get the clean web address.

My code so far:

$link = the_permalink();
return implode(' ', array_slice($words, 0, 50))."<br><a href=\"".$link."\" target='_blank'>Read More</a>";

Custom Excerpt Length and More Link

// custom excerpt length
function custom_excerpt_length( $length ) {
   return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

// add more link to excerpt
function custom_excerpt_more($more) {
   global $post;
   return '<a class="more-link" href="'. get_permalink($post->ID) . '">'. __('Read More', 'exclutips') .'</a>';
}
add_filter('excerpt_more', 'custom_excerpt_more');