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

Tutorial Code Test

The document is a PHP script that defines a function to greet users with their names and favorite colors. It also demonstrates the use of arrays to store names and numbers, and displays them in HTML format. Additionally, it includes a loop to count from 1 to 100 and another loop to greet each name in the array.

Uploaded by

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

Tutorial Code Test

The document is a PHP script that defines a function to greet users with their names and favorite colors. It also demonstrates the use of arrays to store names and numbers, and displays them in HTML format. Additionally, it includes a loop to count from 1 to 100 and another loop to greet each name in the array.

Uploaded by

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

<?

php

function greet($name, $color){

echo "<p>My Name is $name and my Favourite Color is $color </p>";

}
greet('john', 'blue');
greet('jane','green');
?>

<h1><?php bloginfo('name'); ?></h1>


<p><?php bloginfo('description'); ?></p>

<?php
$myName='Shahid'

?>
<p>Hi! my name is <?php echo $myName; ?></p>

<?php
$names= array('Brad','john','jane','Meowsalot');

?>

<p>Hi! my name is <?php echo $names[0]; ?></p>


<?php
$numbers= array('This is the number from ');

?>
<p> <?php echo $numbers[0]; ?></p>
<?php

$count =1;

while($count <101){
echo "<li>$count</li>";
$count++;

}
?>

<?php

$names= array('Brad','john','jane','Meowsalot');

$count =0;

while($count < count ($names)) {


echo "<li> Hello! My Name is $names[$count] </li>";
$count++;

?>

You might also like