Skip to main content

Practical-15

Write a PHP program to perform demonstrates the college Website.​

Introdution​

This tutorial is designed to help students with demonstrating the college Website using PHP programming language. It covers the fundamentals of PHP syntax and coding which is necessary to build a college website. This tutorial requires the students to have a basic knowledge of PHP coding. Also, this tutorial doesn't include any opinions, personal information or any other details which doesn't relates to PHP programming language.

Code​

<?php

$collegeName = "Let's Code College";

// this defines a constant
define("COLLEGE_WEBSITE", "https://www.letscode.com");

echo "Welcome To {$collegeName}.";
echo COLLEGE_WEBSITE;
?>

Output​

Welcome To Let's Code College. https://www.letscode.com
Explanation

The above code starts with opening php tag and declare a variable $collegeName which stores the college name and then define a constant COLLEGE_WEBSITE which stores the college website link using the PHP's define() function. Finally, using the echo statement prints the college name and college website link.

Get Help​