Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing attributes in an XML file in PHP

Status
Not open for further replies.

MJAZ

Programmer
Aug 1, 2006
73
US
Hello! I know how to parse XML with PHP now, except that I do not know how to read the attributes. Here is an example of the code I am using:

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<mail read="0">
	<from>Foo_user</from>
	<subject>Hello!</subject>
	<message>Good morning! How are you?</message>
</mail>

Now, what I want the script to do is it read=0, do something or if it is 1 do something else. It is a mail system, so when the link to the message is clicked, I want the read attribute to equal 1. Thank you in advance!

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top