You can use the session functionality in PHP to determine if a user is logged in or not.
">
<?php
session_start();
if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] === true) {
$link = '/my-account.php';
$text = 'My Account';
} else {
$link = '/login.php';
$text = 'Login';
}
?>
<a href="<?php echo $link; ?>"><?php echo $text; ?></a>