access external php library in your custom module's controller D8

For accessing external php library put your external php library under src/ and add a namespace above your external library.

namespace DrupalYOURMODULENAMElibs;

now in your controller for example ABCController.php use name space as follow

use DrupalYOURMODULENAMElibsparseCSV as CsvFilehandler;

use new instance as follow

$xyz = new CsvFilehandler();

In this way you can access external library in your custom module’s controller

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed