0

I have php installed (via zpanel) in my windows 7 pc and I want to echo php variable using codeblocks by the following way:

<?php
$myname = 'Mr. Arnold';
?>
//in html
my name is {$myname}

is it possible to echo the variable it in html? Actually I intend to create a template using html and php. So I want to echo it in html format.

  • Possible duplicate of [What is the difference between single-quoted and double-quoted strings in PHP?](http://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php) – Sherif Sep 25 '16 at 05:44

3 Answers3

1

Try with

<?php
$myname = 'Mr. Arnold';
echo "my name is {$myname}";
?>
1

In the PHP Block Quoted Example you have to follow the procedure of how you need to echo it so that it will display the Data from that.

PHP Method:

<?php
$myname = "Mr. Arnold";
echo "my name is {$myname}";
?>

HTML method:

<?php
$myname = "Mr. Arnold";
?>
HTML:
my name is <?php echo $myname; ?>;
Naresh Kumar P
  • 4,127
  • 2
  • 16
  • 33
0

Yes you can if you have a VPS server than you can make a changes in php.ini file. but if you don't have a VPS server than make .user.ini file or php.ini and upload it in your Web hosting root folder. Than may be it will work.

shah rushabh
  • 31
  • 2
  • 9