Very very stupid questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
registereduser
Forum Newbie
Posts: 21
Joined: Wed Nov 04, 2009 2:09 pm

Very very stupid questions

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Very very stupid questions

Post 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.
registereduser
Forum Newbie
Posts: 21
Joined: Wed Nov 04, 2009 2:09 pm

Re: Very very stupid questions

Post 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.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Very very stupid questions

Post by McInfo »

To find symbols in the manual, see the List of Parser Tokens.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 1:39 pm, edited 1 time in total.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Very very stupid questions

Post by Eric! »

nice mcinfo
registereduser
Forum Newbie
Posts: 21
Joined: Wed Nov 04, 2009 2:09 pm

Re: Very very stupid questions

Post by registereduser »

McInfo wrote:To find symbols in the manual, see the List of Parser Tokens.
Thank you so much, McInfo.
Post Reply