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

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
else if 구분 좀 알수있을까요?

QA

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

답변 1

본문

 

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"

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

좀 알려주세요~~

 

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로