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?













-3















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










share|improve this question






















  • 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















-3















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










share|improve this question






















  • 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













-3












-3








-3








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










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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











  • The Id="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











  • 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
















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










1 Answer
1






active

oldest

votes


















0














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






share|improve this answer























  • 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










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
);



);













draft saved

draft discarded


















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









0














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






share|improve this answer























  • 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















0














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






share|improve this answer























  • 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













0












0








0







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






share|improve this answer













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







share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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






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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현