downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<DOMImplementationDOMNamedNodeMap>
Last updated: Thu, 26 Jun 2008

DOMImplementation::hasFeature

(No version information available, might be only in CVS)

DOMImplementation::hasFeature — Test if the DOM implementation implements a specific feature

Description

bool DOMImplementation::hasFeature ( string $feature , string $version )

Test if the DOM implementation implements a specific feature .

You can find a list of all features in the » Conformance section of the DOM specification.

Parameters

feature

The feature to test.

version

The version number of the feature to test. In level 2, this can be either 2.0 or 1.0.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 Testing your DOM Implementation

<?php

$features
= array(
 
'Core'          => 'Core module',
 
'XML'            => 'XML module',
 
'HTML'          => 'HTML module',
 
'Views'          => 'Views module',
 
'Stylesheets'    => 'Style Sheets module',
 
'CSS'            => 'CSS module',
 
'CSS2'          => 'CSS2 module',
 
'Events'        => 'Events module',
 
'UIEvents'      => 'User interface Events module',
 
'MouseEvents'    => 'Mouse Events module',
 
'MutationEvents' => 'Mutation Events module',
 
'HTMLEvents'    => 'HTML Events module',
 
'Range'          => 'Range module',
 
'Traversal'      => 'Traversal module'
);
              
foreach (
$features as $key => $name) {
  if (
DOMImplementation::hasFeature($key, '2.0')) {
   echo
"Has feature $name\n";
  } else {
   echo
"Missing feature $name\n";
  }
}

?>


add a noteadd a note User Contributed Notes
Test if the DOM implementation implements a specific feature
There are no user contributed notes for this page.




<DOMImplementationDOMNamedNodeMap>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs