how to save array outputs inside variables in php