kenw232 Posted August 15, 2020 Share Posted August 15, 2020 echo '<td>' . $xmlLineItem -> detail.description . '</td>'; I'm trying to do the above. It won't work because of the . in "detail.description". what do I do? Quote Link to comment https://forums.phpfreaks.com/topic/311334-how-to-echo-xml-element-with-dot-in-name/ Share on other sites More sharing options...
requinix Posted August 15, 2020 Share Posted August 15, 2020 Does the XML actually say <detail.description>? Quote Link to comment https://forums.phpfreaks.com/topic/311334-how-to-echo-xml-element-with-dot-in-name/#findComment-1580654 Share on other sites More sharing options...
kenw232 Posted August 15, 2020 Author Share Posted August 15, 2020 yes, thats the problem. eg. <subfile name="Detail"> <detail> <detail.sequencenumber system="true">3736939</detail.sequencenumber> <detail.lastmodifiedtime system="true">20200512123958</detail.lastmodifiedtime> <detail.parentseq system="true">321595</detail.parentseq> <detail.sort system="true">1</detail.sort> <detail.account>6000031-</detail.account Quote Link to comment https://forums.phpfreaks.com/topic/311334-how-to-echo-xml-element-with-dot-in-name/#findComment-1580655 Share on other sites More sharing options...
requinix Posted August 15, 2020 Share Posted August 15, 2020 You can use variable variables syntax to get to it. echo '<td>' . $xmlLineItem->{"detail.description"} . '</td>'; Quote Link to comment https://forums.phpfreaks.com/topic/311334-how-to-echo-xml-element-with-dot-in-name/#findComment-1580656 Share on other sites More sharing options...
kenw232 Posted August 15, 2020 Author Share Posted August 15, 2020 thats what I need, awesome. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/311334-how-to-echo-xml-element-with-dot-in-name/#findComment-1580657 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.