Added php API code, for reference.