else if 구분 좀 알수있을까요?

else if 구분 좀 알수있을까요?

QA

else if 구분 좀 알수있을까요?

본문

 

if(!function_exists('get_og_from_html')) {
    function get_og_from_html($html){        
        $enc = mb_detect_encoding($html, array("UTF-8", "EUC-KR", "SJIS"));        
        libxml_use_internal_errors(true);
        $doc = new DomDocument();
        $doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', $enc));
        $xpath = new DOMXPath($doc);
        $query = '//*/meta[starts-with(@property, \'og:\')]';
        $metas = $xpath->query($query);
        $og = array();
        foreach ($metas as $meta) {
            $property = $meta->getAttribute('property');
            $content = $meta->getAttribute('content');
            $og[$property] = $content;
        }        
        return $og;
    }
}
 

 

property 일때 <meta property ="og:title"

name    일때  <meta name="og:title"

로 나타내고 싶은데 실력이 너무 없습니다.

좀 알려주세요~~

 

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 59,485
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT