把php代码与HTML代码混写到一起,然后在出错的时候找不到错误,急得团团转,下面我就给大
家讲一下如何用XML技术将HTML代码和PHP程序分离,当然,分离的技术有好多种,比如PEAR中
的IT模板.
总的来说,个人认为使用XML技术是最方便的,废话不多说了,我们言归正传,
讲一下在win2000下的安装
使用php中的xml与xslt要用到一些dll库,
extension=php_domxml.dll //操作XML的函数库
extension=php_iconv.dll //转码用的,比如将GB2312的转成UTF-8的
extension=php_xslt.dll //XSLT的函数库
使用上面这三个库的时候,你要将php安装目录下的dlls目录加入到路径中,否则会找不到
这些类库的
在下面的课程中,我们会用到php中的PEAR类库,主要用了DB类库,Sql2XML类库,大家可以在
pear.php.net上下载最新的版本
下载完上面二个类库以后,大家最好在php.ini中设置一下
include_path = ".;d:phppear"
d:phppear 是我的pear的安装路径
设置完以后,重新启动一下机器,否则因为路径找不到而导致Apache启动不正常,无法正常使用
至此要使用PHP中的XML和XSLT的设置就完成了,是不是很简单:)
使用Linux的用户可以到

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
