Why does this code trigger an error? $string = ‘Shylock in a Shakespeare’s “Merchangt of Venice” demands his pound of flesh.’;

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
  • Strings should always be wrapped in double quotes; and double quotes inside a string should be escaped by backslashes.
  • All single and double quotes inside a string need to be escaped by backslashes to prevent a parse error.
  • The opening and closing single quotes should be replaced by double quotes; and the apostrophe should be escaped by a backslash.
  • The apostrophe needs to be escaped by a backslash to prevent it from being treated as the closing quote.
0/5 (0 Reviews)

Like this article?

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Related Posts