Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
How to read XML in PHP
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Skythrust" data-source="post: 450885" data-attributes="member: 87030"><p>I get no errors to, but I would like to have the XML things as echo.</p><p></p><p>[CODE=xml]<?xml version="1.0" encoding="utf-8"?><Config><DatabaseConnection DataSource="localhost" InitialCatalog="Denzi" UserID="sa" Password="Abc123" /><DatabaseSettings LicenseKey="QMH8-J178-0YDK-5R5Y" LanguageDutch="1" LanguageEnglish="1" GDPRValue="14" Project="Test" UserField="Username" /></Config>[/CODE]</p><p></p><p>[CODE=php]<b>//----- XML Connection Settings -----\\</b></p><p><br><br></p><p><?php</p><p></p><p>error_reporting(E_ALL);</p><p>ini_set('display_errors', 1);</p><p></p><p></p><p>$xmldata = simplexml_load_file("C:\ProgramData\Denzi\Config\Config.xml") or die("Failed to load");</p><p>echo $xmldata->DatabaseConnection[0]->DataSource;</p><p>echo $xmldata->DatabaseSettings[0]->LicenseKey;</p><p></p><p></p><p></p><p>?>[/CODE]</p></blockquote><p></p>
[QUOTE="Skythrust, post: 450885, member: 87030"] I get no errors to, but I would like to have the XML things as echo. [CODE=xml]<?xml version="1.0" encoding="utf-8"?><Config><DatabaseConnection DataSource="localhost" InitialCatalog="Denzi" UserID="sa" Password="Abc123" /><DatabaseSettings LicenseKey="QMH8-J178-0YDK-5R5Y" LanguageDutch="1" LanguageEnglish="1" GDPRValue="14" Project="Test" UserField="Username" /></Config>[/CODE] [CODE=php]<b>//----- XML Connection Settings -----\\</b> <br><br> <?php error_reporting(E_ALL); ini_set('display_errors', 1); $xmldata = simplexml_load_file("C:\ProgramData\Denzi\Config\Config.xml") or die("Failed to load"); echo $xmldata->DatabaseConnection[0]->DataSource; echo $xmldata->DatabaseSettings[0]->LicenseKey; ?>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
How to read XML in PHP
Top