Update php script to work in php7

Lengkap