A

Admin • 828.03K Points
Coach

Q. Which magic method is used to return a string representation of an object?

  • (A) __toString()
  • (B) __string()
  • (C) __print()
  • (D) __str()
  • Correct Answer - Option(A)
  • Views: 7
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin
__toString() is used when an object is treated like a string.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.