Is there in-built function in PHP to convert languages to ISO 639 and ISO 639-2 compliant code? Ie. English would be Eng and En, Spanish Spa and Es.

I have a full list which I could convert to php, but it wouldn't be as convenient to do. Thus I ask if there is a ready solution.