Exercises
Create a script that contains at least five different variables. Populate them with values of different data types and use the gettype() function to print each type to the browser.
Assign values to two variables. Use comparison operators to test whether the first value is
The same as the second
Less than the second
Greater than the second
Less than or equal to the second
Print the result of each test to the browser.
Change the values assigned to your test variables and run the script again.
Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.