Passing a string when starting a class in PHP
Posted
by
Francesc
on Stack Overflow
See other posts from Stack Overflow
or by Francesc
Published on 2010-12-25T10:47:10Z
Indexed on
2010/12/25
10:54 UTC
Read the original article
Hit count: 220
Hi. First I have to say: Happy Christmas to All!
I'm starting learning classes in PHP. I coded that:
class User {
function getFbId($authtoken) {
}
function getFbFirstName ($authtoken) {
}
}
What I want to do is something like that: $user=new User($authtoken);
And pass the $authtoken
to the class. It's possible to define that when starting the class. It's possible to retrive that value inside a function of that class?
© Stack Overflow or respective owner