Date: 02/24/01
- Next message: Bryan Brunton: "[phplib] pg_fetch_array, memory usage, and performance"
- Previous message: Peter Simard: "[phplib] PHP-PHPLIB Gurus"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I found a perl library that puts perl dbi queries into xml. I am thinking about doing the same
thing with PHPLIB. I would sent the XML to XSLT stylesheets.
Has anyone done this before?
Would it be better to use use str_replace in this code?
To see how this works here is the not quite functional code (probably mangled because I am sending
this via Yahoo):
function xml_encode($text) {
$search = array ("'&(quot|#34);'i", "'&(amp|#38);'i", "'&(lt|#60);'i", "'&(gt|#62);'i");
$replace = array ( "\"", "&", "<", ">");
return preg_replace ($search, $replace, $text);
}
function get_xml() {
echo '<?xml version="1.0"?>';
echo '<resultset statement="' . $this->Query_String . '">';
$this->Record = <email protected>($this->Query_ID, $this->Row++, 1);
while (list($key, $val) = each($this->Record)) {
echo "<" . $key . ">" . $this->xml_encode($val) . "</" . $key . ">";
}
echo "</resultset>";
reset($this->Record);
}
Play Merchant Empires (www.merchantempires.net): the only way to conquer the universe using PHPLIB.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Bryan Brunton: "[phplib] pg_fetch_array, memory usage, and performance"
- Previous message: Peter Simard: "[phplib] PHP-PHPLIB Gurus"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

