$sOriginal = ""; $old = '•'; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '
'; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = ' '; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '.'; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '/'; $new = '/'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = ','; $new = ','; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '''; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '&'; $new = '&'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '%'; $new = '%'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '"'; $new = '"'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = ':'; $new = ':'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '‘'; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '’'; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '-'; $new = '-'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '('; $new = '('; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = ')'; $new = ')'; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); $old = '®'; $new = ''; $exp = '/' . $old . '/'; $sShort = preg_replace($exp, $new, $sShort); if (strlen($sShort)>20) { $sShort = substr($sShort,0,20) . "..."; } else { $sShort = $sOriginal; } echo $sShort."\n";