First page in PHP

PHP logo

I am thinking about this for long time. I am not able to write a single page in php. Today I did it. Just to share it with you 🙂

<?php
//title
$title = 'PHP Test';
?>
<html>
<head>
<title><?php echo "$title";?></title>
</head>
<body>
<?php
//create an array
$myArray = array('this', 'is', 'a', 'PHP', 'Test');
for ($i=0; $i<5; $i++)
{
echo "$myArray[$i]";
echo '<br>';
}
?>
</body>
</html>

Prints the following in the browser

this
is
a
PHP
Test

Nice! need to see the data types and database connectivity!

Advertisements