Link to home
Start Free TrialLog in
Avatar of sahanz
sahanz

asked on

What is __( in php

I saw this on a php script, what does that mean (two underscores) ?

__('Read the rest of this page')

Avatar of kumaranmca
kumaranmca

Greetings sahanz,


__ its magic methods..

Refer the below url...its main future of PHP5

http://php.net/manual/en/language.oop5.magic.php

more methods availbale..like __call, __get...
ASKER CERTIFIED SOLUTION
Avatar of jchook
jchook

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PHP automatically creates variable and assigns values to it even is the variables are not defined. But in Object Oriented Programming all the data members/methods needs to be defined.

Magic methods are used to solve this problem. PHP reserves all function names starting with __ as magical.

These methods for overloading purpose. Please refer http://php.net/manual/en/language.oop5.overloading.php
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sahanz

ASKER

Btw this is not a magic method right?
Avatar of sahanz

ASKER

Thank You