Weird error using PHP Simple HTML DOM parser

前端 未结 9 1394
梦谈多话
梦谈多话 2020-11-29 10:30

I am using this library (PHP Simple HTML DOM parser) to parse a link, here\'s the code:

function getSemanticRelevantKeywords($keyword){
    $results = array(         


        
9条回答
  •  -上瘾入骨i
    2020-11-29 11:09

    Simplest solution to this problem

    if ($html = file_get_html("http://www.semager.de/api/keyword.php?q=". urlencode($keyword) ."&lang=de&out=html&count=2&threshold=") {
    
    } else {
        // do something else because couldn't find html
    }
    

提交回复
热议问题