Dynamic Page Title in PHP

 Dynamic Page Title in PHP 

PHP is a server side programming language so can change the title of web page dynamically.

Example :-

<!DOCTYPE html>

<html>

<head>

 <title>

<?php

$a=array

(

"first title",

"Second title",

" Thirrd title",

"fourth title"

);

$i=rand(0,3);

echo "$a[$i]";

 ?>

</title>

</head>

 <body>


</body>

</html>

 

Output:-


when refresh this page then page title change 




 

Post a Comment

0 Comments