PHP | DOMNode isSupported() Function Last Updated : 28 Feb, 2020 Comments Improve Suggest changes Like Article Like Report The DOMNode::isSupported() function is an inbuilt function in PHP which is used to check if the asked feature is supported for the specified version. Syntax: bool DOMNode::isSupported( string $feature, string $version ) Parameters: This function accepts two parameters as mentioned above and described below: $feature: It specifies the feature to test. $version: It specifies the version of feature to test. Return Value: This function returns TRUE on success or FALSE on failure. Below examples illustrate the DOMNode::isSupported() function in PHP: Example 1: php <?php // Write the feature name $featureName1 = "Core"; // Check if it exists $node1 = new DOMNode(); $isSupported1 = $node1->isSupported($featureName1, '1.0'); if ($isSupported1) { echo "Has feature $featureName1 module<br>"; } // Write another feature name $featureName2 = "XML"; // Check if it exists $isSupported2 = $node1->isSupported($featureName2, '2.0'); if ($isSupported2) { echo "Has feature $featureName2 module"; } ?> Output: Has feature Core module Has feature XML module Example 2: php <?php // Write the feature name $featureName1 = "Events"; // Check if it exists $node1 = new DOMNode(); $isSupported1 = $node1->isSupported($featureName1, '1.0'); if (!$isSupported1) { echo "Doesn't has feature $featureName1 module<br>"; } // Write another feature name $featureName2 = "CSS"; // Check if it exists $isSupported2 = $node1->isSupported($featureName2, '2.0'); if (!$isSupported2) { echo "Doesn't has feature $featureName2 module"; } ?> Output: Doesn't has feature Events module Doesn't has feature CSS module Reference: https://www.php.net/manual/en/domnode.issupported.php Comment More infoAdvertise with us Next Article PHP | DOMNode isSupported() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-DOM Similar Reads PHP | DOMNode isSameNode() Function The DOMNode::isSameNode() function is an inbuilt function in PHP which indicates if two nodes are the same node or not. Syntax: bool DOMNode::isSameNode( DOMNode $node ) Parameters: This function accepts a single parameter $node which holds the node to be compared. Return Value: This function return 2 min read PHP | DOMNode lookupPrefix() Function The DOMNode::lookupPrefix() function is an inbuilt function in PHP which is used to get the namespace prefix of the node based on the namespace URI.Syntax:Â Â string DOMNode::lookupPrefix( string $namespaceURI ) Parameters: This function accepts a single parameter $namespaceURI which holds the namesp 1 min read PHP | DOMNode insertBefore() Function The DOMNode::insertBefore() function is an inbuilt function in PHP which is used to insert a new node before a certain another node. Syntax: DOMNode DOMNode::insertBefore( DOMNode $newNode, DOMNode $refNode ) Parameters:This function accepts two parameters as mentioned above and described below: $ne 2 min read PHP | DOMNode normalize() Function The DOMNode::normalize() function is an inbuilt function in PHP which is used to remove empty text nodes and merge adjacent text nodes in this node and all its children. Syntax: void DOMNode::normalize( void ) Parameters: This function doesnât accept any parameters. Return Value: This function does 2 min read PHP | DOMDocument importNode() Function The DOMDocument::importNode() function is an inbuilt function in PHP which is used to return a copy of the node which need to import and associates it with the current document. Syntax: DOMNode DOMDocument::importNode( DOMNode $importedNode, bool $deep = FALSE ) Parameters: This function accepts two 2 min read Like