Leben++

It's never too late to get a life!

Auf Kommentar antworten

Easier, but not universal

If your object has only public fields, then converting the the object with $arr = (array) $object is the easier way. But when some values can only be reached with getters or if your fields are private or protected (as they should be in good design) then a simple array conversion will not work.

Antworten

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Keine HTML-Tags erlaubt
  • Zeilen und Absätze werden automatisch erzeugt.
By submitting this form, you accept the Mollom privacy policy.