PHP Classes

docType: Create HTML or XHTML depending on the user browser

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 33%Total: 453 All time: 6,156 This week: 455Up
Version License PHP version Categories
doctype 1.0Freeware5.0HTML, XML, HTTP, PHP 5
Description 

Author

This class can be used to create HTML or XHTML depending on the user browser.

It analyzes the current HTTP request Accept header and depending on whether the browser accepts XHTML documents or not, it creates a DOM document structure with the right DOCType element for XHTML or not.

The rest of the document structure can be composed with other regular calls to DOM object functions.

Innovation Award
PHP Programming Innovation award nominee
January 2010
Number 8


Prize: One book of choice by Manning
XHTML is standard for defining HTML documents compliant with XML standards.

Web sites may serve their pages in XHTML if the underlying browser supports it.

This class can detect automatically whether the current user browser supports XHTML documents. It serves HTML pages with the correct DOCTYPE and tag structure depending on whether XHTML is supported or not.

Manuel Lemos
Picture of Michael A. Peters
Name: Michael A. Peters <contact>
Classes: 6 packages by
Country: United States United States
Age: 51
All time rank: 882118 in United States United States
Week rank: 214 Up28 in United States United States Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files (5)  
File Role Description
Accessible without login Plain text file content.xml Data Sample XML Content
Accessible without login Plain text file example.php Example Sample script
Accessible without login Plain text file README.php Aux. README file
Accessible without login Plain text file style.css Data Style Sheet
Plain text file xml_doctype.inc Class Main class file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:453
This week:0
All time:6,156
This week:455Up
 User Ratings  
 
 All time
Utility:41%StarStarStar
Consistency:58%StarStarStar
Documentation:-
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:33%StarStar
Rank:4226