<?php
/*When I try to get a some attribute from not validated HTML or XML document, PHP dies with no errors in logs or output:
*/
function is_attribute_value($obj,$type,$value)
{
$_ret=false;
if($obj)
{
if($val=$obj->getAttribute($type))
{
if($val==$value)
{
$_ret=true;
}
}
}
return $_ret;
}
//And this check helped to me:
function is_attribute_value($obj,$type,$value)
{
$_ret=false;
if($obj->attributes)
{
if($val=$obj->getAttribute($type))
{
if($val==$value)
{
$_ret=true;
}
}
}
return $_ret;
}
?>