This is normally a script that is part of a computer program. Such programs can be written in different languages, such as PHP or C++.
A program often comprises a number of scripts to do different things, depending upon the choice of the user. There are sections of code in the programs that are called functions. These accept parameters and do things based on the values of those parameters.
Now, sometimes these functions may do the similar things in different programs.
If you want to have these things done by more than one program, then it is often useful to write these functions in the form of a class. The same class can often be more easily be incorporated into different programs. There are things to consider like global variables, but enough is enough . . .