Moodle - Get courses by category using php script

So, programmer, I heard that you want to get all the moodle courses of a category programmatically? Here you go:



It takes advantages of Moodle's lib/coursecatlib.php.