add array and update write shell script using php