Preprocessing using PHP/XML

This is a discussion on Preprocessing using PHP/XML within the PHP Language forums, part of the PHP Programming Forums category; Hi, I have an HTML help system that I am generating using the PHP CLI. Essentially it is a single ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-23-2004
Nik Coughin
 
Posts: n/a
Default Preprocessing using PHP/XML

Hi,

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",
...etc.
);

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

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
files?

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?

TIA!
--
"Come to think of it, there are already a million monkeys on a million
typewriters, and the Usenet is NOTHING like Shakespeare!" - Blair Houghton
-=-=-=-=-=-=-=-=-=-=-=-
http://www.nrkn.com/
-=-=-=-=-=-=-=-=-=-=-=-


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:52 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0