Posted by: Sourav | February 8, 2011

More String Examples in php


<html>
<head>
<title>
String in php
</title>
</head>
<body>
<?php
echo “Hello World<br />”;
echo ‘Hello World Again<br />’;
$sourav=”Hello West Bengal”;
echo $sourav;
echo “<br />”;
echo $sourav . ” in the darkness<br />”;
?>
<br />
<?php
echo “$sourav again.<br />”;
echo “{$sourav} again.<br />”;
echo ‘$sourav one more time’;//can’t substitute the value of $sourav.
echo “<br />”;
echo “$souravagain.<br />”; //won’t work because php is looking for the variable named $souravagain.
echo ‘{$sourav} again.<br />’; //{} won’t work in ‘ ‘.
?>
</body>
</html>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: