You've got several choices depending on what you're looking for.
serialize($arr) - turns your array into a string, you can then deserialize() the resulting string to turn in back into an array.
Also, var_export and print_r can both take a boolean true as their second argument so that they will return the value instead of printing it out. So, you could say $str = var_export($arr, true)
Sunday, 27th September 2009