rfc:to-array
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:to-array [2020/02/04 13:02] – Update status to under discussion stevenwadejr | rfc:to-array [2020/02/11 12:52] – Remove reference to print_r() casting to array stevenwadejr | ||
---|---|---|---|
Line 44: | Line 44: | ||
<code php> | <code php> | ||
- | print_r($person); | ||
- | |||
- | // Output | ||
- | /* | ||
- | Array | ||
- | ( | ||
- | [name] => John Doe | ||
- | [email] => j.doe@example.com | ||
- | ) | ||
- | */ | ||
- | |||
$personArray = (array) $person; // casting triggers __toArray() | $personArray = (array) $person; // casting triggers __toArray() | ||
</ | </ | ||
Line 106: | Line 95: | ||
<code php> | <code php> | ||
- | print_r(array_keys($person)); | + | print_r( |
+ | | ||
+ | ); | ||
// Output | // Output |
rfc/to-array.txt · Last modified: 2020/02/11 13:57 by stevenwadejr