Display of Variables in PHP
$Name, $_class, $ali
Sample 1 : Common way of Variable
The Answer is = 150
Sample 2 : Variable within double qoutes with curly brackets
My age is 22.
Sample 3 : Variable within double quotes without curly brackets
My age is round about 22.
<html>
<head>
<title>Variable Display in PHP : 3rd Day Lecture</title>
</head>
<body>
<h1 align="center">Display of Variables in PHP<br />
$Name, $_class, $ali</h1>
<h2 align="left">Sample 1 : Common way of Variable</h2>
<?php $a = 100;
$b = 50;
$c = $a + $b;
echo "The Answer is = ".$c ?>
<h2 align="left">Sample 2 : Variable within double qoutes with curly brackets</h2>
<?php $age = 22;
echo "My age is {$age}." #Variable within quotes is defined between curly brackets
?>
<h2 align="left">Sample 3 : Variable within double quotes without curly brackets</h2>
<?php $age=22;
echo "My age is round about $age." //Variable within quotes is defined without curly brackets
?>
</body>
</html>
Post a Comment
Give your reviews about this blog. Leave your comments. What do you think about this post?
Comments Guidelines:
1) I love to read comments, but please avoid spam.
2) Like this blog, share your insights, and spread the word.
3) You can use basic HTML/xHTML tags.
4) All comments are DoFollow—please use the section professionally.
5) Kindly mention your name or brand below your comment.
6) Constructive suggestions for improvement are always welcome.
7) Do not forget to explore our main agency platform at pingbooster.site.
Thanks for visiting Samee Articles.
========================================
Explore custom digital solutions and WordPress plugins at PingBooster Plugins.
Best Regards,
Samee U. Feroz