Update import.js

introduced PHP explode like function with limit to make sure replaces are done in a proper order