PHP | DOMImplementation createDocumentType() function Last Updated : 19 Feb, 2020 Comments Improve Suggest changes Like Article Like Report The DOMImplementation::createDocumentType() function is an inbuilt function in PHP which is used to create an empty DOMDocumentType object. Entity declarations and notations are not available. Syntax: DOMDocumentType DOMImplementation::createDocumentType ( string $qualifiedName = NULL, string $publicId = NULL, string $systemId = NULL ) Parameters:This function accepts three parameters as mentioned above and described below: $qualifiedName (Optional): It specifies the qualified name of the document type to create. $publicId (Optional): It specifies the qualified name of the external subset public identifier. $systemId (Optional): It specifies the external subset system identifier. Return Value: This function returns DOMDocumentType node with its ownerDocument set to NULL. Exceptions: This function throws DOM_NAMESPACE_ERR, if there is an error with the namespace, as determined by $qualifiedName. Below given programs illustrate the DOMImplementation::createDocumentType() function in PHP: Program 1: php <?php // Creates an instance of the DOMImplementation class $imp = new DOMImplementation(); // Creates a DOMDocumentType instance $dtd = $imp->createDocumentType( 'svg:svg', null, 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'); // Get the systemId echo $dtd->systemId; ?> Output: http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd Program 2: php <?php // Creates an instance of the DOMImplementation class $imp = new DOMImplementation(); // Creates a DOMDocumentType instance $dtd = $imp->createDocumentType('GeeksforGeeks'); // Get the name echo $dtd->name; ?> Output: GeeksforGeeks Reference: https://www.php.net/manual/en/domimplementation.createdocumenttype.php Comment More infoAdvertise with us Next Article PHP | DOMImplementation createDocumentType() function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | DOMImplementation createDocument() Function The DOMImplementation::createDocument() function is an inbuilt function in PHP which is used to create a DOMDocument object of the specified type with its document element. Syntax: DOMDocument DOMImplementation::createDocument( string $namespaceURI = NULL, string $qualifiedName = NULL, DOMDocumentTy 2 min read PHP | DOMImplementation __construct() Function The DOMImplementation::__construct() function is an inbuilt function in PHP which is used to create a new DOMImplementation object. Syntax: DOMImplementation::__construct( void ) Parameters: This function doesnât accept any parameter. Below examples illustrate the DOMImplementation::__construct() fu 1 min read PHP | DOMDocument createDocumentFragment() Function The DOMDocument::createDocumentFragment() function is an inbuilt function in PHP which is used to create a new document fragment. Syntax: DOMDocumentFragment DOMDocument::createDocumentFragment( void ) Parameters: This function doesnât accepts any parameters. Return Value: This function returns a ne 2 min read PHP | DOMDocument createComment() Function The DOMDocument::createComment() function is an inbuilt function in PHP which is used to create a new instance of class createComment. Syntax: DOMComment DOMDocument::createComment( string $data ) Parameters: This function accepts single parameter $data which holds the content of the comment node. R 2 min read PHP | DOMDocument createElement() Function The DOMDocument::createElement() function is an inbuilt function in PHP which is used to create a new instance of class DOMElement. Syntax: DOMElement DOMDocument::createElement( string $name, string $value ) Parameters: This function accepts two parameters as mentioned above and described below: $n 2 min read Like