updated php snippets