Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print a value in php file using html [beginner]

Tags:

html

php

Hello i have a php file called a.php that includes a specific value example : $a = 0; i just want to print this value (a) in a html file called b.html is that possible ? thanks

like image 463
hassan atwi Avatar asked Feb 26 '26 01:02

hassan atwi


1 Answers

Sure, you have to open php tag, include php file, echo variable and close php tag For example:

<p><?php include('a.php'); echo $a; ?></p>

like image 118
n-dru Avatar answered Feb 28 '26 18:02

n-dru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!