-1
I have two pages 1st Html and 2nd PHP where I am treating some XML data returned after reading an XML file, but I have a question, I need to take a value that I take from XML and put inside an html tag, I’ve done like this and nothing
the PHP page is being called in HMTL(its extension and .php) by require_once.
SNIPPET OF HTML
<table>
<caption >Ti<?php echo $cnpj ?></caption>
<tr>
<td>John Lennon</td>
<td>Rhythm Guitar</td>
</tr>
<tr>
<td>Paul McCartney</td>
<td>Bass</td>
</tr>
<tr>
<td>George Harrison</td>
<td>Lead Guitar</td>
</tr>
<tr>
<td>Ringo Starr</td>
<td>Drums</td>
</tr>
</table>
EXCERPT FROM PHP
$arq = simplexml_load_file('29190411412201000112650010000000181000000180-nfe.xml') or die("Erro ao carregar arquivo XML");
foreach($arq->NFe->infNFe->children() as $infNFe){
$cnpj = $infNFe->CNPJ;
}
HOW TO CALL A PHP VARIABLE VALUE IN HTML TAG ?
Links to better understand how Sopt works: [Tour], [Ask], Manual on how NOT to ask questions and [Help]. [Edit] the post and reduce the code to a [MCVE] can help a lot to enable the question.
– Bacco