Say I want to print some HTML tags with a variable in it.
I would include all html tags in an echo like this:
A text shows below, which I don't understand why putting plain tags inside a function without print/echo will print out tags, can you explain how below works:
I would include all html tags in an echo like this:
Code:
<?php
...
include("abc.php");
$title = "some title here";
print_head($title);
<?php //abc.php
function print_head($title) { echo("
<html><head><title>$title</title></head>
"); }
?>
A text shows below, which I don't understand why putting plain tags inside a function without print/echo will print out tags, can you explain how below works:
Code:
<?php
...
include("abc.php");
$title = "some title here";
print_head($title);
<?php //abc.php
function print_head($title) {
?>
<html><head>
<title><?php echo $title; ?></title>
</head>
<?php
}