added missing starting php tag

As noted in #473 this fixes the PHP example with missing starting php tag and removes some unneeded empty spaces at the end of the lines.