As you noticed in my first tutorial Getting Started with PHP - What is PHP ? we used opening and closing tags to start writting php commands. You will need these tags whenever you want to write php code :
<?php
//PHP code here
?>
Basic Printing
In the first tutorial we used to print a string on screen. To do that we used the echo command. This command is used to print and show the result of anything you want to. You can print variables ( more on variables in next tutorial ), strings and other stuff. We will get into more detail in the upcoming tutorials.Basically what we did to print that string on screen is used the echo command and the string wrapped inside double quotes.
<?php
echo "This is a string in double quotes to be printed on screen";
?>
PHP can be mixed with html elements to stylize your strings. Take a look at this example
<?php
echo "<h1>This is a h1 tag inside PHP</h1>";
?>
Keep in mind that PHP can do a lot more than just basic printing, and when you will get into more complex stuff, like calculations data processing and other things, you will need to retrieve those results with php commands and wrapped with html tags.
Go ahead and do some experiments with the echo command and with html tags inside, like styling them with CSS or inline CSS. You will see that the result will be as you would write plain HTML. This is the basic syntax in PHP, in the upcoming tutorials we will talk more about variables.
Casino site ᐈ Welcome Bonus up to ₹1500 + 150 Free Spins
ReplyDeleteCasino sites like Slots Empire offer an impressive luckyclub collection of slots, table games, and live dealer games, along with progressive jackpots for their loyal