Save byte array to file in PHP
You need to package the array and save . Well roughly since you did not give details of what you want, nor demonstrated what you already did you can do so:
The exact way can vary according to your needs.
If the format is already in binary, you can just do the recording: