<?php
function stripImages($text)
{
$text = preg_replace('/(<a[^>]*>)(<img[^>]+alt=")([^"]*)("[^>]*>)(</a>)/i', '$1$3$5<br />', $text);
$text = preg_replace('/(<img[^>]+alt=")([^"]*)("[^>]*>)/i', '$2<br />', $text);
$text = preg_replace('/<img[^>]*>/i', '', $text);
return $text;
}
?>