Akhil's Awesome PHP Testing World

Output a string of text

Akhil is awesome

Akhil is awful

Output an integer

1140

8311

Output my First Name

Akhil

Output myNumber Variable containing an integer

1234234344

Output myFName with the string, "is great" as well as myLName using Concat function

Akhil is great

Akhil Pramod

Output different strings with escape special characters

'Ernie's'

Ernie says, "Go Away!"

8\2

"Display $amount"

Output array of names

Levi

Aaron

Ernie

Output the 2nd item in the name array from above

Aaron

Output an associative array with named keys

red

yellow

orange

Output 10+5 using Arithmetic operators

15

Output 10-5 using Arithmetic operators

5

Output 10*5 using Arithmetic operators

50

Output 10/5 using Arithmetic operators

2

Output 45%16 using Arithmetic operators (Remainder when 45 is divided by 16)

13

Output 2 to the 4th power (pow(2,4)) using Arithmetic operators

16

Output basic assignment operator; "a" is assigned the value 15, and a is echoed below

15

Output assignment operator addition; "a" is assigned the value 15, and is then added to itself

30

Output assignment operator subtraction; "a" is assigned the value 15, and is then subtracted to itself

0

Output assignment operator multiplication

225

Output assignment operator division

1

Output assignment operator modulus

13

Output assignment operator incrementation from 15 (by 1)

16

Output assignment operator decrementation from 15 (by 1)

14

If x is set equal to 6, prove it with x ==6 -- Shows 1 if it is true, and does not show a number if it is false

1

If x is set equal to 6, and y is set equal to 6 as well, prove that they are identical with x === y

1

If x is set equal to 6, and y is set equal to 6 as well, prove that they are not equal with x != y. Since there is nothing shown below, it is false

If x is set equal to 6, and y is set equal to "6" but as text. Prove that they are not identical with x !== y. Since one is a number and another is text, they are NOT identical, which means it is true - 1

1

If x is set equal to 6, prove that x < 10

1

If x is set equal to 6, prove that x > 10

If x is set equal to 10, prove that x < or equal to 10

1

If x is set equal to 21, prove that x > or equal to 10

1

Output Good Afternoon if the variable time is 12 or after

Good Afternoon!

Output Heads/Tails based on the Variable side

Tails

Output a greeting based on a time of day

Good Morning!

Case: Carrots (Try Broccoli and Lettuce as well through Inspect Element)

Do you think I am a rabbit?

Output when hour is 8, minute is 59 and time of day is morning - AM - (Making 8:59 AM)

WAKIE WAKIE TIME FOR SHODOR

Output Time for a break if the hour is 10, 12, or 2 -- USE OF OR

Time for a break!

Output what happens when something is NOT true using NOT operator Note: Since it is not true, nothing appears below because false has no output.

Output +1 increment starting from 10 and looping until 15 is reached

10
11
12
13
14
15

Output +1 increment starting from 10 and keep looping WHILE it is still less than 15

10
11
12
13
14
15

DO Output +1 increment starting from 10 and keep looping WHILE it is still less than 15

10
11
12
13
14
15

Output the string length of the string: "This is a string of text"

24

Output whether or not "This is a string of text" is a string

1

Find "text" in the string of text from above

20

Output a part of the string from above, from the 20th character

text

Output lowercase version of string, "ThiS iS a StRiNg Of tEXt"

this is a string of text

Output uppercase version of string, "ThiS iS a StRiNg Of tEXt"

THIS IS A STRING OF TEXT

Output the word count of "This is a string of text"

6

Output the above string in the reverse order

txet fo gnirts a si sihT

Output the above string when "string" is replaced with the word "line"

This is a line of text

Output the above string with the first character in each word capitalized

This Is A String Of Text

Output the above string with it being wrapped after every 10 characters

This is a
string of
text

Output a random number

58

Output the floor of 26.985428734

26

Output the ceiling of 26.985428734

27

Outputs nothing since 10 is a number (is_nan function use)

Outputs the minimum number of the set, 0, 34, 5645, -5456, 50, 2, -200

-5456

Outputs the maximum number of the set, 0, 34, 5645, -5456, 50, 2, -200

5645

Outputs absolute value of -10

10

Output array with new values in it, using array_push function

Array ( [0] => carrots [1] => broccoli [2] => corn [3] => lettuce [4] => potatoes [5] => celery )

Output the number of items in the array of, "carrots, broccoli, corn, lettuce"

4

Output the array of, "carrots, broccoli, corn, lettuce" in alphabetical order using array sort

broccoli
carrots
corn
lettuce

Output text string using the HEREDOC php function

This is a big string of text

Output text string only if the string is set to a variable

This is a big string of text

Output a text string using include_once function

This is a big string of text from another file.

Output array using var_dump

array
  0 => string 'a' (length=1)
  1 => string 'b' (length=1)
  2 => string 'c' (length=1)
  3 => string 'd' (length=1)
  4 => string 'e' (length=1)
  5 => string 'f' (length=1)
  6 => string 'g' (length=1)
  7 => string 'h' (length=1)
  8 => string 'i' (length=1)

Output associative array using print_r

Array ( [broccoli] => green [carrot] => orange [potato] => brown )

Output the numerical array, 2, 4, 6, 8, after using foreach loop to multiply each value by 4

Array ( [0] => 8 [1] => 16 [2] => 24 [3] => 32 )

Output links which get information from another html file and puts it here

  • Get Method: Click Me!
  • You Found Me!

    Post Method form validation

  • Post Method: Click Me!
  • Output test whether or not cookie is set

    Cookie named ' user ' is not set.