PHP echo text being output in incorrect order

In footer.php, I have the following code:

<?php
    $copyYear = 2011; 
    $curYear = date('Y'); 
    echo "&copy; " . $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '') . "&nbsp;" . bloginfo('name');
?>

On the front page of the website, the following is output:

Sugar Gum Cakes© 2011-2014

Note the Blog name is at the start, while in the PHP code it is at the end.

Why is this happening? I can’t see how it would be CSS.

Thanks.

1 Answer
1

bloginfo echoes its value on its own, use get_bloginfo within an echo, which returns its value.

Leave a Comment