Monday 21, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

  creating xml file using php

Here is a script to create xml file using php DOM.
Cut & Paste Script
<html>
<head>
<title>Creating XML using PHP</title>
</head>

<body>

<?php

$document = domxml_new_doc("1.0");

$rootElement = $document->create_element("root");
$new_node = $document->append_child($rootElement);

$itemsElement = $document->create_element("Items");
$items_node = $new_node->append_child($itemsElement);

for($i = 0; $i < 5; $i++) {
$item = $document->create_element("Item");
$item->set_content("This is item $i");
$items_node->append_child($item);
}

$document->dump_file("items.xml");

?>
</body>
</html>
 
   
     RELATED SCRIPTS
 
creating new table in MySql using php
Here is an example to create a new table in mysql database....more »
Category : PHP Examples Hits : 656
   
Reading xml file using php
The easiest way to read a well-formed XML file is to use the Document Object Model (DOM) library compiled into some installations of PHP. The DOM library reads the entire XML document into memory and represents it as a tree of nodes. Here is a script which reads the xml file....more »
Category : PHP Examples Hits : 756
   
Reversing a string using php
This code example will reverse the given string using php....more »
Category : PHP Examples Hits : 715
   
Email validation using regular expression php
Here is a php script to validate email address. We are using regular expression for validation....more »
Category : PHP Examples Hits : 1010
   
Comparing two arrays using php
This code example will take two arrays and compares 2nd array with 1st. It will show the list of elements which are not found in the first array....more »
Category : PHP Examples Hits : 649
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download Super Affiliate Strategies Ebook Super Affiliate Strategies
   
Download  Your Ultimate Inspirational Guide Ebook Your Ultimate Inspirational Guide
   
Download How To Bookmark For Free Traffic Ebook How To Bookmark For Free Traffic
   
Download Video Marketing Tactics Using Ebook Video Marketing Tactics Using
   
Download Handbook of Information Security Management  Ebook Handbook of Information Security Management
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz