No need to open and close PHP so many times.