samedi 2 avril 2016

php if or codeigniter

i have started using http://ift.tt/1TrlXoC for codeigniter, and it works great. One problem, in the librari, on this function for example:

public function get_description(){
    if(!$page_description = $this->dom->find('head meta[name=Description]', 0)){
        return false;
    }

    return $this->clean_text($page_description->content);
}

this will search in the Description and show the tags, but if the html file has description written with 'small d' it wont find it, so im trying to do something like this but i cannot manage to make it work. my attempt :

public function get_description(){
    if(!$page_description = $this->dom->find('head meta[name=Description]', 0) || !$page_description = $this->dom->find('head meta[name=description]', 0) ){
        return false;
    }

    return $this->clean_text($page_description->content);
}

Any other ideas? Thanks

Aucun commentaire:

Enregistrer un commentaire