Added solution although limited by PHP without extra packages