I'm learning PHP and following an exercise — I'm writing some data to a file. When I use single quotes, it does not use the line break or variables:
function add_registered_user($name, $email){
file_put_contents('mailing_list.php', '\n$name: $email');
};
But when when I use double quotes (like the tutorial author), it works perfectly:
function add_registered_user($name, $email){
file_put_contents('mailing_list.php', "\n$name: $email");
};
How come? And are there many other quirks in PHP that are reliant on one over another?