Anonymous
public php v1 · immutable$news_txt = preg_replace('/\[img id\=(.*?)\]/is', $this->Img2Out("$1"), $news_txt);!class thisfunction Img2Out($img_id){ $this->DB("table"); $img_res = mysql_query("SELECT * FROM news_img WHERE img_id='$img_id'"); $ir = mysql_fetch_array($img_res); if(@mysql_num_rows($cat_res) == 1) { return "<img src=\"/news/".$img_name."\" alt=\"\" />"; } else { return $img_id; }}