예제 #1
0
function pf_str_get_html($str, $lowercase = true, $forceTagsClosed = true, $target_charset = PF_DEFAULT_TARGET_CHARSET, $stripRN = true, $defaultBRText = PF_DEFAULT_BR_TEXT)
{
    $dom = new pf_simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $defaultBRText);
    if (empty($str)) {
        $dom->clear();
        return false;
    }
    $dom->load($str, $lowercase, $stripRN);
    return $dom;
}
예제 #2
0
 /**
  * Get the pf_simple_html_dom object for a given URL
  */
 public static function get_simple_dom_object($url)
 {
     $dom = null;
     $response = wp_remote_get($url);
     if (!empty($response) && !is_wp_error($response)) {
         $dom = new pf_simple_html_dom(null);
         $dom->load(wp_remote_retrieve_body($response));
     }
     return $dom;
 }