How to use single quote inside an echo which is using single quote

Nasir Zia picture Nasir Zia · Aug 3, 2012 · Viewed 85.4k times · Source

First of all, i have gone through the related questions.. haven't found any answer.. I m using this code to display a message

echo 'Here goes your message with an apostrophe S like thi's ';

How can i make this work, as any quote inside this echo will break the statement...

Answer

Madara's Ghost picture Madara's Ghost · Aug 3, 2012

Either escape the quote with a backslash, or use double quotes to designate the string.

echo 'Here goes your message with an apostrophe S like thi\'s';

echo "Here goes your message with an apostrophe S like thi's";