Sign Up Login Videos
1

PHP DomDocument() Language Problem

1

PHP DomDocument() Language Problem

Hi, I want to create a web crawler using php. I am using this {{"

class DomDocumentParser{
private $doc;

public function __construct($url){
  global $crawlerName;
  $options = array(
    'http' => array('method'=>"GET", 'header'=>"User-Agent: $crawlerName\n")
  );
  $context = stream_context_create($options);
  $this->doc = new DomDocument();
    @$this->doc->loadHTML(@file_get_contents($url, false, $context));
}
public function getTitleTags() {
    return $this->doc->getElementsByTagName("title");
}

}
"}}. But when i try crawl hindi language. It will returning this {{ ¤µà¤¿à¤µà¤°à¤£ }}

  • PHP
  • HTML
  • howcode.org

1 Replies

This is because PHP doesn't know the language Hindi so it gets cryptic 😋

0

This is because PHP doesn't know the language Hindi so it gets cryptic 😋

x