/    Sign up×
Community /Pin to ProfileBookmark

PHP array syntext

hey guys the below syntex kidda confuses me , please check it out :

[code=html] $data = array(
“username” => “‘$this->username'”,
“password” => “‘$this->hashedPassword'”,
“email” => “‘$this->email'”,
“join_date” => “‘”.date(“Y-m-d H:i:s”,time()).”‘”
);[/code]

why the additional ‘ ‘ for all lines ?

eg .

“username” => “‘$this->username'”,

why not “$this->username” ???

instead of “‘$this->username'” .

Thanks .

Gautam.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@iBeZiDec 02.2014 — The quotes have nothing to do with array syntax, the value in the array will just be wrapped in quotes.
Copy linkTweet thisAlerts:
@gautamz07authorDec 02.2014 — Thanks !
×

Success!

Help @gautamz07 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...