Condensing multiple echo statements into one in PHP?

I am relatively new to PHP and want to know a more efficient way of echo’ing the following in less steps or even just one statement.

echo '<div class="title-area"><a href="';
echo site_url();
echo '">';
echo get_bloginfo( 'name' );
echo '</a></div>';

Currently this outputs a div containing a link of the blog title and a href of the site.

Related posts

1 comment

  1. How about this

    echo '<div class="title-area"><a href="'.site_url().'">'.get_bloginfo( 'name' ).'</a></div>';
    

    You just need to use concatinate instead of echo it multiple times

Comments are closed.