Search code examples
phpsyntaxstring-concatenation

Can strings have a dangling concatenation operator?


OK, so here's the snippet:

// start rememberMe
$cookie_name = 'db_auth';

$cookie_time = (3600 * 24 * 30); // 30 days
    
// check to see if user checked box
if ($remember == 1) {
    setcookie ($cookie_name, 'username='.$username., time() + $cookie_time);
} 

For some reason it breaks and I can't see why. It is part of a larger function which works fine when I comment this snippet out. Any ideas?


Solution

  • You have an extra dot after "$username" in the second last line.