you can do
$msg_gifted="<center><h1>It's a gift! </h1>";
or
$msg_gifted='<center><h1>It\'s a gift! </h1>';
Updated answer
You can not use the same quote inside the string without escaping the quote. So you either use different quotes surrounding the string or you escape it with \. Simplified your code to show different possibilites which will all have the same output.
String in single ' quotes
$msg = '<h1>It\'s a gift!</h1><img src="http://path-to-image.jpg" />';
which is almost the same as tring in double " quotes
$msg = "<h1>It's a gift!</h1><img src=\"http://path-to-image.jpg\" />";
Or string concatenation with different quotes just as you prefer:
$msg = "<h1>It's a gift!</h1>";
$msg.= '<img src="http://path-to-image.jpg" />';