You are writing a PHP script and you decide to use Object-Oriented Programming. How would you define a class?
- Using the class keyword
- Using the define() function
- Using the object keyword
- Using the function keyword
In PHP, to define a class when using Object-Oriented Programming (OOP), you would use the class keyword followed by the name of the class. The correct option is "Using the class keyword." For further details, refer to the PHP documentation on defining classes: http://php.net/manual/en/language.oop5.php
Loading...
Related Quiz
- What is the most convenient hashing method to be used to hash passwords?
- What PHP function can be used to read a file?
- In PHP, $_POST is a superglobal array that is used to collect form data after submitting an HTML form with ______ as the method.
- What is a common use case for the $_POST superglobal in PHP?
- To make a single-line comment in PHP, you can use ______ or ______ at the beginning of the line.