470,848 Members | 1,569 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Preprocessing using PHP/XML


I have an HTML help system that I am generating using the PHP CLI.
Essentially it is a single PHP file that has a few arrays at the top of the
file, before it starts spitting out HTML, like so:

$strHelpContext = "Shape";

$arrQuestionHeader = array(
"change a shape's properties",
"transform a shape",

$arrQuestionBody = array(
"Some html about change a shape's properties
goes here",
"Some html about transform a shape goes here",

At the moment I have five PHP files which are identical aside from the
arrays at the top, one for each help topic. Very inelegant. I have moved
the contents of all of the arrays from the five files into a nicely
structured XML file.

My question:

What would be the best way to use this XML data to generate 5 seperate HTML

I am using the PHP CLI. I was thinking maybe I could just pass the CLI the
var $strHelpContext, ie in the example above this is "Shape", and have my
PHP script search through the XML file for the help section with the same
name, then populate the arrays from that. Is this the best way to do it?
If so, how do I pass the PHP CLI a variable?

"Come to think of it, there are already a million monkeys on a million
typewriters, and the Usenet is NOTHING like Shakespeare!" - Blair Houghton
Jul 17 '05 #1
0 1191

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ron | last post: by
12 posts views Thread by Francois Grieu | last post: by
4 posts views Thread by Henrik Goldman | last post: by
5 posts views Thread by Francois Grieu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.