String is the collection of characters which is stored in a single variable. PHP provides many in-built functions to use strings.
We need to enclose the string within double quote or single quote. We can store any string value into a variable or we can print the value directly instead, depends upon the need.
We can use both single and double quote for string creation. Now php introduces more robust technique called heredoc method to create string of multiple line.
echo'This is the first string within single quote<br/>';
echo"This is the second string within double quote<br/>";
$string="Value from string variable";
This is a multiple line string
using heredoc method.
This is the first string within single quote
This is the second string within double quote
Put some value to string variable
This is a multiple line string using heredoc method.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: December 17, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles