Home   |   About   |   Terms   |   Contact    
A platform for writers

Different ways to define Strings in PHP.

PHP Articles

☯ All PHP Articles     ☯ All Articles

Popular Google Pages:

◕ A platform for writers Details..

◕ Story writing competition. Details..

This article is regarding
Different ways to define Strings in PHP.
Last updated on: .

◕ Different ways to define Strings in PHP.
We can define Strings in our programs in three different ways.

These are: Single quotes, Double quotes, Here Document.

Examples are given below:

1) Single quotes
echo 'We are Indian.';
echo '<h1>We are Indian.</h1>';

2) Double quotes
echo "We are Indian.";
echo '"We are Indian," he said.';
echo "<h1>We are Indian.</h1>";

■ 3) ▻ Here Document
<h1>This is PHP.</h1>

What is Here Document?
Difference between Single quoted & Double quoted String?

Related articles:
Difference between Single quoted string & Double quoted string
Different way to define string in PHP?
What is Here Document in PHP?
What is PHP?
How Browser communicates with Server?
How PHP Works?
How to use PHP inside HTML?

Top of the page

Amazon & Flipkart Special Products


Top of the page