Using escape sequences in strings

Strings with single quotes

<?php
  $dir = 'C:\\xampp\\php';                     // C:\xampp\php
  $name = 'Mike\'s Music Store';               // Mike's Music Store
  $quote = "He said, \"It costs \$12.\"";      // He said, "It costs $12.”
  $comment1 = "This is a\nmulti-line string."; // This is a
                                               // multi-line string.
  $comment2 = 'Not a\nmulti-line string.';     // Not a\n multi-line string.
?>

Back