Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. preg_match_all('#<img.*src="(.*)".*>#isU', $value, $match);                        
  2.                         if(!empty($match[0][0])&&!empty($match[1][0])){
  3.                             $img = $match[0][0];
  4.                             $src = $match[1][0];
  5.                         }
  6.                         $arURL = parse_url($src);
  7.                         if(empty($arURL['host'])){
  8.                             if($src[0]!='/'){
  9.                                 $src = 'http://articles.fitness-pro.ru/'.$src;
  10.                             } else {
  11.                                 $src = 'http://articles.fitness-pro.ru'.$src;
  12.                             }
  13.                         }
  14.                         $bData['PREVIEW_PICTURE'] = CFile::MakeFileArray($src);
  15.                         $bData[$bKey] = strip_tags($value, '<p><a><span><br>');
  16.                         $bData['PREVIEW_TEXT_TYPE'] = "html";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement