How to use apostrophe in a PHP echo
In PHP, the escape character is the backslash (\). You can add this before special characters to ensure that these characters appear as letters.
Here are two ways you can make a php string containing apostrophe in a PHP echo:
1. With backslash (\) :
echo 'Lennart\'s name with an apostrophe, like thi\'s';
2. Or you can also type your PHP echo with Quotation marks (") :
echo "Lennart's name with an apostrophe, like thi's";
Hi, I'm Lennart. WordPress developer from Denmark. I write most in Danish, but the piece of code itself is universal and can be understood outside Denmark as well 😀