Tweaked php snippets