Page 1 of 1

Very very stupid questions

Posted: Wed Nov 04, 2009 2:28 pm
by registereduser
I am new, brand new. I have following questions which can't searched from google, since they are signs.

I see this: function _stripslashes_rcurs($variable, $top=true)
What is mean $top=true here? $top is a parameter, why it immediately becomes true?

I see this: $this->uid = null;
What is mean -> here? Does $this have same meaning as "this" in java?

I see this:
$this->fields = array('username' => '',
'password' => '',
'emailAddr' => '',
'isActive' => false
);
What is mean => here?

Many thanks.

Re: Very very stupid questions

Posted: Wed Nov 04, 2009 2:41 pm
by requinix
registereduser wrote:I see this: function _stripslashes_rcurs($variable, $top=true)
What is mean $top=true here? $top is a parameter, why it immediately becomes true?
It means $top is optional, and if you don't provide it the default value is true.

Code: Select all

_stripslashes_rcurs($a); // $top = true
_stripslashes_rcurs($a, $b); // $top = $b
registereduser wrote:I see this: $this->uid = null;
What is mean -> here? Does $this have same meaning as "this" in java?
Yes, they mean the same thing. With that in mind, guess what -> is for.
registereduser wrote:I see this:
$this->fields = array('username' => '',
'password' => '',
'emailAddr' => '',
'isActive' => false
);
What is mean => here?
$this->fields is an associative array, sometimes called a hash or dictionary.
What's on the left of the => is the key, what's on the right is the value. If you don't give a key then it will be a number that started counting at 0. More information here.


If Google can't help, the PHP manual probably can.

Re: Very very stupid questions

Posted: Wed Nov 04, 2009 3:09 pm
by registereduser
Thank you very much tasairis! All set now.

Indeed, I have tried the php manual, but it does not enable sign search too.

Re: Very very stupid questions

Posted: Wed Nov 04, 2009 3:56 pm
by McInfo
To find symbols in the manual, see the List of Parser Tokens.

Edit: This post was recovered from search engine cache.

Re: Very very stupid questions

Posted: Wed Nov 04, 2009 6:47 pm
by Eric!
nice mcinfo

Re: Very very stupid questions

Posted: Sun Nov 08, 2009 11:24 pm
by registereduser
McInfo wrote:To find symbols in the manual, see the List of Parser Tokens.
Thank you so much, McInfo.