reworking the php code samples