본문에서 이미지 추출 정보
본문에서 이미지 추출본문
if(0 == preg_match("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $write[wr_content], $match)){
$file = sql_fetch("select * from g5_board_file where bo_table='$bo_table' and wr_id='$write[wr_id]' and bf_no='0'");
$imgurl = thumbnail($g5[path]."/data/file/$bo_table/$file[bf_file]","144","99",0,1);
} else{
$exp = explode("/data/",$match[1]);
$imgurl = thumbnail("$g5[path]/data/".$exp[1],"144","99",0,1); // img/imgart.png
}
추천
2
2
댓글 5개
초짜여서 누구 해석 좀 해주세요
그냥 컨텐츠에 이미지 태그가 있으면 board_file 테이블 접속해서 썸네일 있으면 url 불러오고 아니면 썸네일을 생성한다는 뜻이에요^^
오 이거 꼭필요했는데 감사합니다
감사합니다
잘쓰겠습니다.