MemoryRefresh!

String type



Questions 1 Answers 0%

Pages   0 from 51
Questions   0 from 84

Reset



* Strings Single quotes (variables and escape sequences will not be interpreted and replaced)
<?php $a = 'a'; echo $b = '$an'; // output $an Double quotes (variables and escape sequences will be interpreted and replaced)
<?php $a = 'a'; echo $b = "$an"; // output a Herodoc (for multiple lines). Allow for the use of quotes without escaping. It is very important to note that the line with the closing identifier must contain no other characters, except possibly a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon. It's also important to realize that the first character after the closing identifier must be a newline as defined by the local operating system.
<?php $who = "John"; $output = <<<TEST She said "This is $who's test" on multiple rows TEST; echo nl2br($output); /* output She said "This is John's test" on multiple rows */
https://stackoverflow.com
Questions

Related pages

Basic syntax !
Numeric type !
String type !
Boolean type !
Constants definition !
Control structures !
Reference !


0% 100%
 
 
0 pages 51 pages
1) What is the value of $b ? <?php $a = "a"; $b = '$a n'; echo $b;





2) What is the value of $b ? <?php $a = 'a'; $b = "$a n"; echo $b;





Last Review: n/a   Passed: n/a   Reviews: n/a   Next Review: n/a  


* Strings Single quotes (variables and escape sequences will not be interpreted and replaced)
<?php $a = 'a'; echo $b = '$an'; // output $an Double quotes (variables and escape sequences will be interpreted and replaced)
<?php $a = 'a'; echo $b = "$an"; // output a Herodoc (for multiple lines). Allow for the use of quotes without escaping. It is very important to note that the line with the closing identifier must contain no other characters, except possibly a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon. It's also important to realize that the first character after the closing identifier must be a newline as defined by the local operating system.
<?php $who = "John"; $output = <<<TEST She said "This is $who's test" on multiple rows TEST; echo nl2br($output); /* output She said "This is John's test" on multiple rows */
https://stackoverflow.com



More from Php

Basics
Variables
Operators
Function
Array
String
Streams
Uncategorized


More from Programming

Php
jQuery




Powered by minte9.com