使用php在moodle中创建一个课程

I have been a searching a lot on this

I want to create a course using Web service API of moodle. Things I understood so far are

  1. There is a function named core_course_create_courses
  2. Need to create a access token
  3. I have a code which uses curl class which I dont know how to configure on my server(godaddy domain) hosting

Please someone have done this post code or suggest me some tutorial to follow.

Enable web services in Moodle - https://docs.moodle.org/30/en/Using_web_services

Then read through these instructions for creating a client - https://docs.moodle.org/dev/Creating_a_web_service_client

There is a php example here - https://github.com/moodlehq/sample-ws-clients/tree/master/PHP-REST