Ok, I'm working on a regexp that will cut strings if they are above x characters. The problem is that cut's up my links and image urls as well ... SO i want it to ignore the characters within <> and evaluate everything else ... so, is it possible? This is what I've done so far, and it work, but cut links;
function WrapWords($str, $chars) {
$str = preg_replace('/([0-9A-Za-z]{'.$chars.','.$chars.'})/', '\1 ', $str);
return $str;
}
echo WrapWords($string, 20);
Ideas?