Potresti anche serializzare l'array con
serialize()

Semplice e veloce.