updated php-script for php 5.6