associative array - what does the following syntax in php mean? -
i working on fixing bug in legacy php code. not php person. please bear me if stupid question.
i see line in code:
$credentials = array("username"=>$fields->username, "password"=>$fields->password); $this->profile->create($fields);
i don't understand syntax array means?
i know associate array:
array("username"=>"mike","password"=>"123"
) translate
{ "username": "mike", "password" : "123" }
but above 1 translate to?
in code used example, $fields
object. then, username
variable or property of object. so, end array:
{ "username": $fields->username, "password": $fields->password }
if confused arrow syntax objects, read documentation on using objects php.
Comments
Post a Comment