phpリッチテキストボックスを置換して画像のパスを返します。


public function imagUrl($content){
if (preg_match('/(http:\/\/)|(https:\/\/)/i', $content)) {
    $url = "";
}else{
    $url = "http://" . $_SERVER['SERVER_NAME'];
}
$pregRule = "//";
$list = preg_replace($pregRule, ' ', $content);
return $list;
)