I tried find('meta[http-equiv="Content-type"]') but it failed to retrieve that information.
I tried find(‘meta[http-equiv=Content-type]’) but it failed to retrieve that information.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SimpleHTMLDom doesn’t use quoted string literals in the selector. It’s just
elem[attr=value]. And the comparison of value seems to be case-sensitive (there may be a way to make it case-insensitive, but that I don’t know)*E.g.
prints
text/html; charset=ISO-8859-1.*edit: yes, there is a way to perform a case-insensitive match, use
*=instead of=edit2: btw that
http-equiv*=content-typethingy would also match<meta http-equiv="haha-no-content-types"...(it only tests if the string is somewhere in the attribute’s value). But it’s the only case-insensitive function/operator I could find. I guess you can live with it in this case 😉edit 3: It uses preg_match(‘…/i’) and the pattern/selector is directly passed to that function. Therefore you could do something like
http-equiv*=^content-type$to matchhttp-equiv="Content-type"but nothttp-equiv="xyzContent-typeabc". But I don’t know if this is a warranted feature.