This class is as follows:
require_once('JSLibraryLoad.class.php'); $library = new JSLibraryLoad( 'http://ajax.googleapis.com/ajax/libs/jquery/', 'jquery.min.js', '1.5.0', '1.4.4' ); echo $library->fetchLibrary();
The use of regular expressions in this class it's not 100% efficient, because it doesn't take into account the case of libraries having always a pattern like
1.x in their version number. Further, a more robust exception handling routine would be required while trying to load the major version. Anyway, feel free to improve it, as you like.