Vidyalelo
MySQL · Q525

MySQL

Programming · MySQL · question 525

Q525

In PHP, which operator is used to access property of an object?

A.
.
B.
*
C.
->
Answer
D.
@

Answer: Option C

Solution

Answer: Option C
Solution:
This question asks about how you access parts of an object in PHP. Think of an object like a box with different things inside.
To get something out of the box, you need the right tool.
The correct answer is Option C: ->
The -> operator is like the key to open the box and get the specific item you want.
For example, to get the "name" property from an object called "myObject," you'd write:
$myObject->name

The other options are not used for accessing object properties:
* Option A: . is used for string concatenation.
* Option B: * is used for multiplication.
* Option D: @ is used for error suppression.