file_get_html

The NextGEN Gallery file get html function.

Description

Parameters (11)

0. $url
The url.
1. $use_include_path — Optional. (constant) => false
The use include path.
2. $context — Optional. (constant) => null
The context.
3. $offset — Optional. (int) => -1
The offset.
4. $maxlen (int)
The maxlen.
5. $lowercase — Optional. (constant) => true
The lowercase.
6. $forcetagsclosed (constant)
The forcetagsclosed.
7. $target_charset — Optional. (constant) => DEFAULT_TARGET_CHARSET
The target charset.
8. $striprn (constant)
The striprn.
9. $defaultbrtext (constant)
The defaultbrtext.
10. $defaultspantext (constant)
The defaultspantext.

Usage

  1. if ( !function_exists( 'file_get_html' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php'; 
  3.  
  4. // The url. 
  5. $url = null; 
  6.  
  7. // The use include path. 
  8. $use_include_path = false; 
  9.  
  10. // The context. 
  11. $context = null; 
  12.  
  13. // The offset. 
  14. $offset = -1; 
  15.  
  16. // The maxlen. 
  17. $maxlen = -1; 
  18.  
  19. // The lowercase. 
  20. $lowercase = true; 
  21.  
  22. // The forcetagsclosed. 
  23. $forcetagsclosed = null; 
  24.  
  25. // The target charset. 
  26. $target_charset = DEFAULT_TARGET_CHARSET; 
  27.  
  28. // The striprn. 
  29. $striprn = null; 
  30.  
  31. // The defaultbrtext. 
  32. $defaultbrtext = null; 
  33.  
  34. // The defaultspantext. 
  35. $defaultspantext = null; 
  36.  
  37. // NOTICE! Understand what this does before running. 
  38. $result = file_get_html($url, $use_include_path, $context, $offset, $maxlen, $lowercase, $forcetagsclosed, $target_charset, $striprn, $defaultbrtext, $defaultspantext); 
  39.  

Defined (1)

The function is defined in the following location(s).

/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php  
  1. function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT
  2. // We DO force the tags to be terminated. 
  3. $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); 
  4. // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done. 
  5. $contents = file_get_contents($url, $use_include_path, $context, $offset); 
  6. // Paperg - use our own mechanism for getting the contents as we want to control the timeout. 
  7. //$contents = retrieve_url_contents($url); 
  8. if (empty($contents) || strlen($contents) > MAX_FILE_SIZE
  9. return false; 
  10. // The second parameter can force the selectors to all be lowercase. 
  11. $dom->load($contents, $lowercase, $stripRN); 
  12. return $dom;