Text inside quotation marks allows practically all characters except the same single quotation mark symbol inside the text. If this is needed, you put the text inside double quotation marks instead.
The text may contain any number of leading, trailing and inside spaces.
'Hello World' differs from 'Hello World'.
Plain text can be used for
Good Examples | Interpretation | Bad Examples | Interpretation |
---|---|---|---|
'Hello World' | Text | 'Hello World" | Delimits with wrong quotation mark |
'123' | Text | '123 | Not properly delimited |
' Hello World ' | Text (2 spaces inside) | ||
'' | Text (blank value) | ||
'100 €' | Text (100 €) | 100 € | Syntax error: & abd ; are B4P symbols |
'-' | Text | ||
'true' | Text | ||
'"Hi!"' | Text, "Hi!" |
echo( 'Hello World' );
echo( ' Hello World ' );
echo( 'One + One' );
echo( '"In double quotation Marks"' );
echo( 'Price tags: € 10.00, € 10.00, € 10.00');
echo( '3 * 2 = 6' );
echo( 'A cheap way to continue on the next line' ); // Not recommended. Use '...', new line, '...' instead.
echo( new line, 'Line 1', new line, 'Line 2' );
Hello World
Hello World
One + One
"In double quotation Marks"
Price tags: € 10.00, € 10.00, € 10.00
3 * 2 = 6
A cheap way to continue on
the next line
Line 1
Line 2
Plain text
Text inside double quotation marks
Multi-line text
softquoted strings