Question: PHP Q1. Print the following statement to the browser: Hello, home home sweet home. Next, create two variables, one for the word Hello and one

PHP

Q1.

Print the following statement to the browser:

"Hello, home home sweet home."

Next, create two variables, one for the word Hello and one for the word home. Print the statement to the browser again but this time substitute the relevant words with your variables. Remember to include the
tag to show your statements on different lines.

Q2.

In your script, create the following variables:

$a=8;

$b=6;

$c=5;

Write a php script to print out the following:

Delta= -124 where the solution calculated using 62-4*8*5

Formula: b2-4*a*c

When the values of variables change your output should change accordingly.

Q3.

For this PHP exercise, write a script using the following variables: $a="Around";

$d=80;

Using single quotes (' '), the concatenation operator, the variables created, and a single echo statement, echo the following to the browser. When the values of variables change your output should change accordingly.

Around The World in 80 Days.

Q4.

Find and correct the errors for the PHP script below.

$color="red";

echo "My car is $Color
";

echo "My car is $color
";

echo "My car is $coLor
";

?>

Q5.

Try the following PHP script.

Hello

$currentTime = date( "g:i:s a" );

echo "Hello, world! The current time is $currentTime";

?>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!