View the step-by-step solution to:

Question

Creates 2 variables $x and $y, with values 1 and 5

write an if statement that compares the two values to

check if they are equal

If $x is equal to $y, echo "these two variables are equal" else, if they are not equal, echo "They are not equal".

Test your code using an online PHP emulator and paste the code and results in the table cell below.

  1. Write and test PHP code that does the following:

Creates 2 variables $x and $y, with values 1 and 5

write a PHP function named compareTwoVars that has two entry arguments $a and $b

In the function body, write PHP code that compares $a and $b to check if they are equal

If $a is equal to $b, echo "These two variables are equal", else if they are not equal, then echo "They are not equal"

Call the function with the two-variable $x and $y


  1. write and test PHP code that does the following:
  2. Creates 2 variables $a and $b, with values 1 and 5
  3. write an if statement that compares the two values using a less-than comparison operator
  4. If $a is less than $b, echo "that the first variable is less than the second variable"

Test your code using an online PHP emulator and paste the code and results in the table cell below

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes