0% found this document useful (0 votes)
2 views6 pages

PHP Overview

The document outlines a lab report assignment that includes tasks such as creating an HTML form for personal data entry, generating a table, and developing a static website portfolio. It also contains various PHP code snippets demonstrating basic programming concepts, including variable declarations, arrays, functions, and string manipulation. Additionally, it features comments and examples of static variables in PHP.

Uploaded by

daxom27234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

PHP Overview

The document outlines a lab report assignment that includes tasks such as creating an HTML form for personal data entry, generating a table, and developing a static website portfolio. It also contains various PHP code snippets demonstrating basic programming concepts, including variable declarations, arrays, functions, and string manipulation. Additionally, it features comments and examples of static variables in PHP.

Uploaded by

daxom27234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab Report Assignment 1.

Write a HTML program to design a form which should allow you to enter your
personal data( Hint: make use of text field, password field, e-mail,
lists, radio buttons, checkboxes, submit button).

Write a HTML code to generate the following table.

Create Your Portfolio static website (Index,Education ,Experiences Page)


<?php
echo "Hello world";
?>

<?php
/* This is a section
of multi-line comments
which will not be
interpreted */
?>

<?php
$mycounter = 1;
$mystring = "Hello";
$myarray = array("One", "Two", "Three");
?>

<?php // test1.php
$username = "Fred Smith";
echo $username;
echo "<br>";
$current_user = $username;
echo $current_user;
?>

<?php
$oxo = array(array('x', ' ', 'o'),
array('o', 'o', 'x'),
array('x', 'o', ' '));

echo $oxo[1][2];
?>

<?php
$author = "Steve Ballmer";

echo "Developers, Developers, developers, developers, developers,


developers, developers, developers, developers!

- $author.";
?>

<?php

$text = "Measuring programming progress by lines of code is like


$author = "Bill Gates";
Measuring aircraft building progress by weight.

- $author.";

echo $text;

?>

<?php
$author = "Brian W. Kernighan";

echo <<<_END
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

- $author.
_END;
?>
?php
$author = "Scott Adams";

$out = <<<_END
Normal people believe that if it ain’t broke, don’t fix it.
Engineers believe that if it ain’t broke, it doesn’t have enough
features yet.

- $author.
_END;
?>

<?php
$number = 12345 * 67890;
echo substr($number, 3, 1);
?>

<?php
$pi = "3.1415927";
$radius = 5;
echo $pi * ($radius * $radius);
?>

<?php
function longdate($timestamp)
{
return date("l F jS Y", $timestamp);
}
?>

<?php
function longdate($timestamp)
{
$temp = date("l F jS Y", $timestamp);
return "The date is $temp"; }?>
<?php
$temp = "The date is ";
echo longdate(time());

function longdate($timestamp)
{
return $temp . date("l F jS Y", $timestamp);
}
?>

<?php
$temp = "The date is ";
echo $temp . longdate(time());

function longdate($timestamp)
{
return date("l F jS Y", $timestamp);
}
?>

<?php
$temp = "The date is ";
echo longdate($temp, time());

function longdate($text, $timestamp)


{
return $text . date("l F jS Y", $timestamp);
}
?>

<?php

echo test();
echo "<br><br>";
echo test();

function test()
{
static $count = 0;
echo $count;
$count++;
}
?>

<?php
static $int = 0; // Allowed
static $int = 1+2; // Disallowed (will produce a Parse error)
static $int = sqrt(144); // Disallowed
?>

You might also like