You are currently viewing PHP Tutorial: Mixing HTML with PHP
PHP Tutorial: Mixing HTML with PHP

PHP Tutorial: Mixing HTML with PHP

HTML with PHP -: Whenever, we want to show dynamic representation of Hyper-text data for users, we have to mix HTML with PHP. HTML gives us the feature of encapsulation of hyper-text.

In other words -: HTML is the basic building block of website development, and in the absence of HTML, you can not represent any textual and graphics editing on the web browser or on a Web Server. Don’t more think about this paragraph’s meaning, I will show you what I want to say with a meaningful example.


Hello my all dear Visitors, welcome again in this domain (www.bittutech.com) for learning technical things or several hacks. We can learn a lot of things from here such as programming languages, android tricks, and tips, windows tricks, and tips, Kali Linux hacking(Only for educational purposes), and various technical graduation subjects( that are under-publishing). You can also jump to the root domain page through this link (www.bittutech.com).


Today, I am going to show you interesting things about PHP. We all know that PHP is a server-side scripting language, this language doesn’t contain any structural tags like HTML. So, we can not obtain any structural and graphical format through this scripting language(PHP). We will need to create a structure for documents and that need can be fulfilled only by the HTML.


Mixing and un-mixing of HTML with PHP

I will show you a basic example of mixing and un-mixing HTML and PHP. PHP does only logical and mathematical works and prints them on the web browser without any editing, but, when we use HTML with PHP, we can represent text and other documents with various types of graphical formats. Let’s see an example for more clarification.


Example of without mixing HTML with PHP –

<!DOCTYPE html>
<html>
<head>
<title>
Un-mixing of HTML with PHP
</title>
<?php
echo "This is a text but not a covering of HTML. Simple text based lines";
?>
</head>
<body bgcolor="orange">
</body>
</html>

Output -:


Example of mixing HTML with PHP

<!DOCTYPE html>
<html>
<head>
<title>
Un-mixing of HTML with PHP
</title>
<?php
echo "<h1>This is a text but a covering of HTML h1 Tag Hyper-text</h1>";
echo "<h2>These all html tags encapsulate php print's text, and this is called HTML with PHP</h2>";
?>
</head>
<body bgcolor="orange">
</body>
</html>

Output -:


This is a simple example to differentiate of mixing and un-mixing of HTML with PHP. you can do more things with the help of HTML tags inject into your PHP Script.


Last words -: So PHP programmers, this is enough knowledge for today. We will cover next topic in our next article that will come soon. Instead of this, you can learn more interesting topic in other categories that has been mentioned in this domain. Ok, thank you so much and please give me a lot of help and support to write more articles, and one more thing, you can join us on social network to get the latest and daily updates.


Share post

Prajjwal Singh

Tech Blogger || Web developer || Computer Networking Enthusiast || Microsoft SQL Database Management Expert || Software Debugger || Learned DOS OS Structure

Leave a Reply