Constructor
Example:
require_ones( 'php4-html-dom.php' );
API Tags:
htmlNode|NULL &getElementById(
string
$aId
)
|
|
Find a single node by id case insensitive
Source:
return $this->RootNode->findNodeByAttributeDown( 'id', $aId );
else
return NULL;
}
Example:
if (isset($myNode))
Parameters:
string |
$aId: |
Id attribute of node to be searched for |
API Tags:
htmlNode|NULL &getElementByName(
string
$aName
)
|
|
Find a single node by name case insensitive
Source:
return $this->RootNode->findNodeByAttributeDown( 'name', $aName );
else
return NULL;
}
Example:
if (isset($myTextInput))
Parameters:
string |
$aName: |
Name attribute of node to be searched for |
API Tags:
htmlNode|NULL &getElementByTagName(
string
$aTagName
)
|
|
Find a single node by tag name case insensitive
Source:
return $this->RootNode->findNodeDown( $aTagName );
else
return NULL;
}
Example:
if (isset($myNode))
echo $myNode->Attrubites['id'];
Parameters:
string |
$aTagName: |
Tag name of node to be searched for |
API Tags:
array|NULL getElementsById(
string
$aId
)
|
|
Find multiple nodes by id case insensitive
Source:
$tempResult =
$this->RootNode->findNodesByAttributeDown( 'id', $aId );
if (count($tempResult)>
0)
return $tempResult;
else
return NULL;
} else
return NULL;
}
Example:
if (isset($myImages))
foreach( $myNodes as $key => $obj )
Parameters:
string |
$aId: |
Id attribute of nodes to be searched for |
API Tags:
array|NULL getElementsByName(
string
$aName
)
|
|
Find multiple nodes by name case insensitive
Source:
$tempResult =
$this->RootNode->findNodesByAttributeDown( 'name', $aName );
if (count($tempResult)>
0)
return $tempResult;
else
return NULL;
} else
return NULL;
}
Example:
if (isset($myControls))
foreach( $myControls as $key => $obj )
Parameters:
string |
$aName: |
Name attribute of nodes to be searched for |
API Tags:
array|NULL getElementsByTagName(
string
$aTagName
)
|
|
Find multiple nodes by name case insensitive
Source:
$tempResult =
$this->RootNode->findNodesDown( $aTagName );
if (count($tempResult)>
0)
return $tempResult;
else
return NULL;
} else
return NULL;
}
Example:
if (isset($myImages))
foreach( $myNodes as $key => $obj )
echo $myNodes[$key]->Attributes['src'].'<br>';
Parameters:
string |
$aTagName: |
Tag name of nodes to be searched for |
API Tags:
Read the current HTML
Example:
API Tags:
void parse(
string
$aHtml
)
|
|
Parse an HTML string
Example:
$myParser->parse( '<b>Hello</b> <i>world</i>!' );
Parameters:
string |
$aHtml: |
String containing HTML to be parsed |
API Tags: