PHP
  Home arrow PHP arrow Working with the Tidy Library in PHP 5
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Working with the Tidy Library in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2007-06-26

    Table of Contents:
  • Working with the Tidy Library in PHP 5
  • Parsing (X)HTML strings
  • Implementing the tidy_clean_repair() function
  • Using the tidy_parse_file() and tidy_repair_file() functions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Working with the Tidy Library in PHP 5


    (Page 1 of 4 )

    As a PHP developer, you've probably developed database-driven applications that deliver their contents in (X)HTML format to the end user. If so, you know that when you work directly with hard-coded (X)HTML files, you risk forgetting to close tags and DTD headers, making the process annoying and time-consuming. Keep reading; help is on the way.

    Introduction

    As you know, hand-coding (X)HTML files certainly forces your PHP applications to have a clean and tight presentation layer, but actually giving your code this quality comes at a cost. You'll need to verify that all those files have been created in the correct format. Is there any way to make this process as painless as possible?

    Of course there is! If you've ever worked with code editors like Home Site and Dreamweaver MX, to name just two, then you'll recall that all of them incorporate the popular Tidy application as part of their arsenal of code-cleaning tools. It's extremely useful for correcting rapidly any errors that have occurred while coding (X)HTML files.

    However, the real good news about Tidy is that you can take advantage of its neat features by accessing it from your PHP files, since this excellent code-cleaning package is now available as an external library in PHP 5. This means that you can correct any source (X)HTML files very efficiently and with minor hassles.

    Thus, now that you know that the Tidy (X)HTML formatting/correcting application can be called directly from your own PHP 5 scripts, over the course of this series, which is comprised of three friendly tutorials, I'm going to walk you through using the bunch of useful functions included with this library. Naturally I'll accompany the corresponding theory with a decent number of code samples, so you can learn quickly how to make this PHP extension work for you in a very short time.

    Now, it's time to get rid of the preliminaries and start learning how to work with the Tidy library and PHP 5. Let's go!

    More PHP Articles
    More By Alejandro Gervasio


       · In case you didn't know, it's possible to access the main fatures of the popular...
     

       

    PHP ARTICLES

    - Viewing and Editing Tasks for a Project Mana...
    - More on Private Methods with PHP 5 Member Vi...
    - Adding Tasks to a Project Management Applica...
    - Utilizing Private Methods with PHP 5 and Mem...
    - Making Changes in a Project Management Appli...
    - Defining Public and Protected Methods with M...
    - HTML for a Project Management Application
    - Using Subclasses and Accessors with Member V...
    - Implementing Internet Protocols with PHP
    - Project Management: The Application
    - Working with Private Properties to Protect P...
    - Protecting PHP 5 Class Data with Member Visi...
    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway