How to read this file into PHP - Not WorkingHow can I prevent SQL injection in PHP?Deleting an element from an array in PHPConvert HTML + CSS to PDF with PHP?startsWith() and endsWith() functions in PHPHow do I get PHP errors to display?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How do I check if a string contains a specific word?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?
Does "boire un jus" tend to mean "coffee" or "juice of fruit"?
Find the closest three-digit hex colour
When does it become illegal to exchange bitcoin for cash?
Are the Gray and Death Slaad's Bite and Claw attacks magical?
Existence of infinite set of positive integers s.t sum of reciprocals is rational and set of primes dividing an element is infinite
Why is my 401k manager recommending me to save more?
Tricky riddle from sister
Aligning arrays within arrays within another array
Odd PCB Layout for Voltage Regulator
Is there a connection between representation theory and PDEs?
How far can gerrymandering go?
Russian equivalents of 能骗就骗 (if you can cheat, then cheat)
What type of education should I select in this form?
Simplify the code
Why doesn't SpaceX land boosters in Africa?
Making arrow with a gradual colour
SQL Server Ignoring Instance name when using port number of different instance
How soon after takeoff can you recline your airplane seat?
My players like to search everything. What do they find?
Is it OK to say "The situation is pregnant with a crisis"?
Is this house-rule removing the increased effect of cantrips at higher character levels balanced?
Can I hire several veteran soldiers to accompany me?
Trace in the category of propositional statements
Disk usage confusion: 10G missing on Linux home partition on SSD
How to read this file into PHP - Not Working
How can I prevent SQL injection in PHP?Deleting an element from an array in PHPConvert HTML + CSS to PDF with PHP?startsWith() and endsWith() functions in PHPHow do I get PHP errors to display?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How do I check if a string contains a specific word?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?
I am looking for some help with a project I am doing, using php to read in an xml file. I have spent the last 35 Hours reading everywhere but to no avail. Basically, I am looking for feedback on how to read this piece of xml code into PHP. I am not majorly comfortable with PHP so may not understand the syntax or commands fully. I can take in single elements but I can't when it has the Id part like below.
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
I am looking for the information for my php website.
If anyone could help me I would be so grateful
php xml
add a comment |
I am looking for some help with a project I am doing, using php to read in an xml file. I have spent the last 35 Hours reading everywhere but to no avail. Basically, I am looking for feedback on how to read this piece of xml code into PHP. I am not majorly comfortable with PHP so may not understand the syntax or commands fully. I can take in single elements but I can't when it has the Id part like below.
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
I am looking for the information for my php website.
If anyone could help me I would be so grateful
php xml
Google for SimpleXML, or DOMDocument.
– Jonnix
Mar 25 at 17:28
I have done this, still cannot get it going. I just need to get the part figured with the id tag and I can finish the rest myself
– Student Engineer
Mar 25 at 17:30
TheId="3"
tag is a CSS style reference. Have you set up your CSS styles yet?
– elbrant
Mar 27 at 16:34
add a comment |
I am looking for some help with a project I am doing, using php to read in an xml file. I have spent the last 35 Hours reading everywhere but to no avail. Basically, I am looking for feedback on how to read this piece of xml code into PHP. I am not majorly comfortable with PHP so may not understand the syntax or commands fully. I can take in single elements but I can't when it has the Id part like below.
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
I am looking for the information for my php website.
If anyone could help me I would be so grateful
php xml
I am looking for some help with a project I am doing, using php to read in an xml file. I have spent the last 35 Hours reading everywhere but to no avail. Basically, I am looking for feedback on how to read this piece of xml code into PHP. I am not majorly comfortable with PHP so may not understand the syntax or commands fully. I can take in single elements but I can't when it has the Id part like below.
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
I am looking for the information for my php website.
If anyone could help me I would be so grateful
php xml
php xml
asked Mar 25 at 17:27
Student EngineerStudent Engineer
1
1
Google for SimpleXML, or DOMDocument.
– Jonnix
Mar 25 at 17:28
I have done this, still cannot get it going. I just need to get the part figured with the id tag and I can finish the rest myself
– Student Engineer
Mar 25 at 17:30
TheId="3"
tag is a CSS style reference. Have you set up your CSS styles yet?
– elbrant
Mar 27 at 16:34
add a comment |
Google for SimpleXML, or DOMDocument.
– Jonnix
Mar 25 at 17:28
I have done this, still cannot get it going. I just need to get the part figured with the id tag and I can finish the rest myself
– Student Engineer
Mar 25 at 17:30
TheId="3"
tag is a CSS style reference. Have you set up your CSS styles yet?
– elbrant
Mar 27 at 16:34
Google for SimpleXML, or DOMDocument.
– Jonnix
Mar 25 at 17:28
Google for SimpleXML, or DOMDocument.
– Jonnix
Mar 25 at 17:28
I have done this, still cannot get it going. I just need to get the part figured with the id tag and I can finish the rest myself
– Student Engineer
Mar 25 at 17:30
I have done this, still cannot get it going. I just need to get the part figured with the id tag and I can finish the rest myself
– Student Engineer
Mar 25 at 17:30
The
Id="3"
tag is a CSS style reference. Have you set up your CSS styles yet?– elbrant
Mar 27 at 16:34
The
Id="3"
tag is a CSS style reference. Have you set up your CSS styles yet?– elbrant
Mar 27 at 16:34
add a comment |
1 Answer
1
active
oldest
votes
This how you do it
Save this as note.xml in the same directory where your php code resides
<?xml version="1.0" encoding="UTF-8"?>
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
save this below as xml.php and run the code
<?php
$xml=simplexml_load_file("note.xml");
echo $xml->Name . "<br>";
echo $xml->Type . "<br>";
echo $xml->Pulse . "<br>";
echo $xml->Delay;
?>
Your output will be
Line 3
0
False
0
Thanks
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343415%2fhow-to-read-this-file-into-php-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This how you do it
Save this as note.xml in the same directory where your php code resides
<?xml version="1.0" encoding="UTF-8"?>
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
save this below as xml.php and run the code
<?php
$xml=simplexml_load_file("note.xml");
echo $xml->Name . "<br>";
echo $xml->Type . "<br>";
echo $xml->Pulse . "<br>";
echo $xml->Delay;
?>
Your output will be
Line 3
0
False
0
Thanks
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
add a comment |
This how you do it
Save this as note.xml in the same directory where your php code resides
<?xml version="1.0" encoding="UTF-8"?>
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
save this below as xml.php and run the code
<?php
$xml=simplexml_load_file("note.xml");
echo $xml->Name . "<br>";
echo $xml->Type . "<br>";
echo $xml->Pulse . "<br>";
echo $xml->Delay;
?>
Your output will be
Line 3
0
False
0
Thanks
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
add a comment |
This how you do it
Save this as note.xml in the same directory where your php code resides
<?xml version="1.0" encoding="UTF-8"?>
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
save this below as xml.php and run the code
<?php
$xml=simplexml_load_file("note.xml");
echo $xml->Name . "<br>";
echo $xml->Type . "<br>";
echo $xml->Pulse . "<br>";
echo $xml->Delay;
?>
Your output will be
Line 3
0
False
0
Thanks
This how you do it
Save this as note.xml in the same directory where your php code resides
<?xml version="1.0" encoding="UTF-8"?>
<OutputLine Id="3" Text="Output Line 3">
<Name>Line 3</Name>
<Type>0</Type>
<Pulse>False</Pulse>
<Delay>0</Delay>
</OutputLine>
save this below as xml.php and run the code
<?php
$xml=simplexml_load_file("note.xml");
echo $xml->Name . "<br>";
echo $xml->Type . "<br>";
echo $xml->Pulse . "<br>";
echo $xml->Delay;
?>
Your output will be
Line 3
0
False
0
Thanks
answered Mar 25 at 18:08
Nancy MooreeNancy Mooree
9021 gold badge3 silver badges10 bronze badges
9021 gold badge3 silver badges10 bronze badges
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
add a comment |
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
If you want to print the result as object you can try this. <?php $xml=simplexml_load_file("note.xml"); print_r($xml); ?>
– Nancy Mooree
Mar 25 at 18:14
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Let me know if it solve your problem
– Nancy Mooree
Mar 25 at 18:15
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
Thanks you soooooo much for taking the time to reply, my problem is that it is a significantly large xml file. It's from a Cognex Vision job. I need to be able to reference, this type of the xml file first; <OutputLine Id="3" Text="Output Line 3"> because there are lots of them. I'm trying to find them so I can insert the information they hold, into a website. So, I can show Pass/Fail results of parts
– Student Engineer
Mar 25 at 19:44
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
I got sorted; This is my code;
– Student Engineer
Mar 25 at 20:09
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343415%2fhow-to-read-this-file-into-php-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Google for SimpleXML, or DOMDocument.
– Jonnix
Mar 25 at 17:28
I have done this, still cannot get it going. I just need to get the part figured with the id tag and I can finish the rest myself
– Student Engineer
Mar 25 at 17:30
The
Id="3"
tag is a CSS style reference. Have you set up your CSS styles yet?– elbrant
Mar 27 at 16:34