Challenge: Make Variables

Declare variables in PHP and assign values to them.

We'll cover the following

Problem Statement

  • Declare an int type variable and name it $intNumber and assign it a value of 1000.
  • Declare a char type variable and name it $charName and assign it a value of N.
  • Declare a boolean type variable and name it $boolAccept and assign it a value of true.
  • Declare a float type variable and name it $floatNum and assign it a value of 10.292.

Now output these values on the console using the echo function in PHP. The values should be separated by a comma.

Output

1000, N, 1, 10.292

Coding Exercise

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy