en/joomla-tutorial-vorwort/
Opened this issue · 4 comments
Preface | Astrid Günther
If you are new to Joomla, please read Absolute basics of how a component works[^docs.joomla.org/Absolute_Basics_of_How_a_Component_Functions…
In the single/double quotes section you have
echo 'Start with a single string';
echo 'String with an apostrophe';
echo 'String with a php variable'.$name;
On my screen the line "with an apostrophe" would not include an apostrophe. Did you mean to include an escape char or an html entity there (or both for completeness)?
I hope I understand you correctly. It's not about showing the quotes on the website. It's about how PHP handles stings: https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single
Yes indeed, so I would expect the line to be
echo 'String with an \' apostrophe';
Illustrating how you would embed an apostrophe in a string. An alterative being to use double quotes around the string.
echo "String with an ' apostrophe" ;
A trivial point but it just jarred when I read it as your string with an apostrophe didn' t include an apostrophe.
@rogercreagh Thank you very much, I think I have understood it correctly now. (The apostrophe was removed automatically when the html code was created.) Now it should be correct.
It may be that the browser cache has to be cleared for the display to be correct.