-1
Hello I’m starting to learn PHP, and I created an HTML input that receives an XML file that should be read in PHP but I’m having difficulties, I’m using the simplexml_load_file more when I call the xml data does not return anything just like in this print:

I wonder how I can solve?
My code: (index.php)
<html>
<body>
<form action="teste.php" method="post" enctype="multipart/form-data">
    <label for="myfile">coloque o arquivo XML:</label>
    <input type="file" id="myfile2" name="myfile2"><br><br>
    <input type="submit" value="Submit">
</form>
(php test.)
<html>
<body>
<?php
 $myfile2 = $_FILES['myfile2']['tmp_name'];
 $dados_xml = simplexml_load_file($myfile2);
 echo $dados_xml
?>
</body>
</html>
						
you want to show the xml on the screen?
– novic
that same the xml content, actually only a few fields but for starters yes
– user198451