Thanks a lot 🙂
After removing those things i still had to remove the links and reduce the length
The code i ended up with:
//
// Parse the changes over text
//
function text_without_brackets($str)
{
if (($l_pos = strpos($str, '[')) !== false) {
$r_pos = strpos($str, ']', $l_pos + 1);
$len = $r_pos - $l_pos + 1;
$str = substr_replace($str, '', $l_pos, $len);
$str = text_without_brackets($str);
}
return $str;
}
function trim_array_values($array, $max_length)
{
$result = array();
foreach ($array as $index => $value)
{
if (strlen($value) > $max_length)
$value = substr($value, 0, $max_length) . '...';
$result[$index] = $value;
}
return $result;
}
for ($blue=0;$blue < 7;$blue++) {
$text[$blue] = text_without_brackets($text[$blue]);
$text[$blue] = str_replace('"', '', $text[$blue]);
}
$text = preg_replace("/(http:\/\/(.*)\/)[\S]*/", "", $text);
$text = trim_array_values($text, 65);
//
// END CHANGING TEXT
//