Database Reference
In-Depth Information
"E-Mail" : [
" pm@example.com " ,
" pm@office.com " ,
" philip@example.com " ,
" philip@office.com " ,
" moran@example.com " ,
" moran@office.com " ,
" pmoran@example.com " ,
" pmoran@office.com "
],
"Phone" : "617-546-8428",
"Age" : 60
})
The same document would look like this when contained in an array in PHP:
$contact = array(
"First Name" => "Philip",
"Last Name" => "Moran",
"Address" => array(
"Street" => "681 Hinkle Lake Road",
"Place" => "Newton",
"Postal Code" => "MA 02160",
"Country" => "USA"
)
,
"E-Mail" => array(
" pm@example.com " ,
" pm@office.com " ,
" philip@example.com " ,
" philip@office.com " ,
" moran@example.com " ,
" moran@office.com " ,
" pmoran@example.com " ,
" pmoran@office.com "
),
"Phone" => "617-546-8428",
"Age" => 60
);
The two versions of the document look a lot alike. The obvious difference is that the colon (:) is replaced as
the key/value separator by an arrow-like symbol (=>) in PHP. You will get used to these syntactical differences
relatively quickly.
Search WWH ::




Custom Search