I am scraping the DOM of a static site with PHP and pulling out specific bit's of data so I can put stuff into a database.
For this example I am storing the inner HTML of an element to $domString
, I can see the string is 'Description', but when I compare $domString
to 'Description' in the code there isn't a match.
if($domString == 'Description') {
// This is not happening, even though I know
// $domString contains 'Description' :(
}
I have striped whitespace and stuff, when I var_dump()
them both out I get this:
string(45) "Description"
string(11) "Description"
Running them both through bin2hex()
as Álvaro G. Vicario suggests returns the following two values respectively:
3c74642076616c69676e3d22746f702220636f6c7370616e3d2232223e4465736372697074696f6e3c2f74643e
4465736372697074696f6e
I need a way to strip wahtever is beefing that first string out.