Updated PHP code