Updated php snippet