Write a PHP script that outputs "Hello, World!" using the `echo` statement.
(No input is required for this task)
Hello, World!
Write a PHP script that calculates the sum, difference, and product of two numbers and prints the results.
$a = 5;
$b = 3;
Sum: 8
Difference: 2
Product: 15
Write a PHP script that checks if a number is positive, negative, or zero, and prints an appropriate message.
$num = -3;
The number is negative.
Write a PHP script that accepts a string and prints the following: - The string in all uppercase. - The string in all lowercase. - The length of the string.
$str = "Hello PHP!";
Uppercase: HELLO PHP!
Lowercase: hello php!
Length: 10
Write a PHP script that uses a `for` loop to print numbers from 1 to 10.
(No input is required for this task)
1
2
3
4
5
6
7
8
9
10
Write a PHP script that creates an array of five integers, and then prints the sum and the largest number in the array.
$arr = [1, 2, 3, 4, 5];
Sum: 15
Largest number: 5