Hi,
The PHP examples you're referring to are to be run by itself, either via an apache server (i.e. MAMP for localhost or real web server) with PHP or terminal. There is a README.md file in the PHP examples, along with another README.md in the /demo/ folder, where it will contain steps to create/upload/update content and add to a collection.
The Wordpress and Drupal plugin have their own coding framework and style, so you can't copy and paste from one to another.
- Mike