Stripping the_content() from images then displaying them seperately

maybe use this regex:

$pattern = "/<a(.*?)href=('|\")([^>]*)('|\")(.*?)><img(.*?)src=('|\")([^>]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)class=('|\")([^>]*)('|\")(.*?)\/><\/a>/i";



function example_replace ($content) {
   global $post;

   $pattern = "/<a(.*?)href=('|\")([^>]*)('|\")(.*?)><img(.*?)src=('|\")([^>]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)class=('|\")([^>]*)('|\")(.*?)\/><\/a>/i";
   $replacement="<a$1href=$2$3$4$5><img$6src=$7$8.$9$10$11class=$12$13 <strong>imagelink</strong>$14$15$16/><\/a>";
   $content = preg_replace($pattern, $replacement, $content);

   return $content;
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)