Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-09-2007, 03:48 AM   PM User | #1
binaryWeapon
Regular Coder

 
Join Date: Sep 2007
Location: AZ, USA
Posts: 685
Thanks: 6
Thanked 46 Times in 46 Posts
binaryWeapon is on a distinguished road
Writing to XML

Quick question:

Can you write to an xml file with the php fopen() and fwrite(), etc the same way as with a txt file?
binaryWeapon is offline   Reply With Quote
Old 11-09-2007, 03:53 AM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
Pretty much yeah. Just make sure you add the xml declaration to the content and have it save as an .xml file.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 11-09-2007, 04:44 AM   PM User | #3
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
It's far easier to use SimpleXML for both reading and writing.
Inigoesdr is offline   Reply With Quote
Old 11-11-2007, 05:50 PM   PM User | #4
binaryWeapon
Regular Coder

 
Join Date: Sep 2007
Location: AZ, USA
Posts: 685
Thanks: 6
Thanked 46 Times in 46 Posts
binaryWeapon is on a distinguished road
On the simpleXML page:
Quote:
The SimpleXML extension requires PHP 5.

My hosting plan has PHP4.
binaryWeapon is offline   Reply With Quote
Old 11-11-2007, 06:10 PM   PM User | #5
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,711
Thanks: 2
Thanked 251 Times in 243 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
The end of life of php4 is the end of this year. Your web host will be forced to upgrade of get left behind.

They might already have php5 available, either through your control panel or through a statement in a .htaccess file. Check with them if and how you can switch to php5, or what their plan is to upgrade (this is not an "if" they are upgrading, but a "when" they are upgrading issue.)
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is online now   Reply With Quote
Old 11-11-2007, 06:14 PM   PM User | #6
binaryWeapon
Regular Coder

 
Join Date: Sep 2007
Location: AZ, USA
Posts: 685
Thanks: 6
Thanked 46 Times in 46 Posts
binaryWeapon is on a distinguished road
Quote:
Originally Posted by CFMaBiSmAd View Post
The end of life of php4 is the end of this year. Your web host will be forced to upgrade of get left behind.

They might already have php5 available, either through your control panel or through a statement in a .htaccess file. Check with them if and how you can switch to php5, or what their plan is to upgrade (this is not an "if" they are upgrading, but a "when" they are upgrading issue.)
Willdo! Thanks for your reply!
binaryWeapon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:00 PM.


Advertisement
Log in to turn off these ads.