+1 vote
in PHP by
String values in PHP must be enclosed within -

a) Double Quotes

b) Single Quotes

c) Both (a) and (b)

d) None of the above

1 Answer

0 votes
by

c) Both (a) and (b)

Description:

There are 4 ways to specify a string literal in PHP.

  • single quoted
  • double quoted
  • heredoc syntax
  • newdoc syntax (since PHP 5.3)

We can create a string in PHP by enclosing the text in a single-quote. It is the easiest way to specify string in PHP. In PHP, we can specify string through enclosing text within double quote also. But escape sequences and variables will be interpreted using double quote PHP strings.

Related questions

0 votes
asked Mar 19, 2020 in PHP by DavidAnderson
0 votes
asked May 21, 2019 in Mathematics by sheetalkhandelwal
...