I am trying to get this done:

<?php 
global $current_user;
get_currentuserinfo();
if ( is_user_logged_in() ) {
    echo '<span class="ciao">HELLO ' . $current_user->user_login . '</span>'; "\n"; 
    echo '<a href=" . wp_logout_url( home_url() ); . " title="Logout">Logout</a>';
}
else {
    echo '<a href=" . wp_login_url( get_permalink() ); . " title="Login">Login</a>';
}
?>

However , href provides me with back the empty value: wordpress_logout_url( home_url() )

After I make use of this WORDPRESS call outdoors the echo it works good, such as this eg:

<a href="<?php echo wp_logout_url( home_url() ); ?>">LOGOUT</a>

How do i write this ??

echo '<a href="' . wp_logout_url( home_url() ) . '" title="Logout">Logout</a>';

echo '<a href=" . wp_logout_url( home_url() ); . " title="Logout">Logout</a>';

Must be transformed to

echo '<a href="' . wp_logout_url( home_url() ) . '" title="Logout">Logout</a>';

String began with single quote must be closed with single quote.

I believe what you would like is:

<?php global $current_user; 
get_currentuserinfo(); 
if ( is_user_logged_in() ) { echo '<span class="ciao">HELLO ' . $current_user->user_login . '</span>'; "\n"; 
echo '<a href="' . wp_logout_url( home_url() ); . '" title="Logout">Logout</a>'; } else { echo '<a href="' . wp_login_url( get_permalink() ); . '" title="Login">Login</a>'; } ?>

The various may be the string is closed before caused by wordpress_logout_url() is concatenated by using it

It is because you haven't ended you string

You would make use of the following:

echo "<a href=\"" . wp_login_url( get_permalink() ); . "\"/>;

None of individuals was, however i appreciated. This is effective:

'<a href="'.wp_logout_url( home_url() ).'">text</a>