Problem 1:


Description:

Write a program to print “Hello World” using echo only

Conditions:

You cannot use any variable

Solution:

echo "Hello World";

Output:

Hello World


Problem 2:


Description:

Write a program to print “Hello PHP” using php variable?

Conditions:

You can not use text directly in echo but can use variable.

Solution:

$text = "Hello PHP";
echo "$text";

Output:

Hello PHP


Problem 3:


Description:

Write a program to print “Welcome to the PHP World” using some part of the text in variable & some part directly in echo.

Conditions:

You have to use a variable that contains string “PHP World”.

Solution:

$text1 = "PHP World";
echo "Welcome to the $text1";

Output:

Welcome to the PHP World