Any idea how can join and ID with another set of data and then print out certain information?
I want to print out The name and the country of a user. I am stuck already for a few hours and I would appreciate any help and suggestion!
XML:
<Project>
<Partner>
<PartnerRef>1</PartnerRef>
<DaysNb>40</DaysNb>
</Partner>
</Project>
<Partners>
<Partner>
<Id>1</Id>
<Name>UNI1</Name>
<Country>CH</Country>
</Partner>
</Partners>
php code:
foreach($InfoSystem->xpath('//Project') as $project){
$projectId = $project->Id;
echo $projectId;
$selectedPartner = $project->xpath('//PartnerRef');
echo($selectedPartner);
echo "Title: " . $project->Submission->Title;
echo "<br>";
echo "Acronym: " . $project->Submission->Acronym;
echo "<br>";
echo "Abstract: " . $project->Submission->Abstract->Parag->Fragment;
echo "<br>";
echo $project->Submission->Abstract->List->asXML();
echo "<br>";
foreach($InfoSystem->xpath('//Partner') as $partner){
if(in_array($partner, $selectedPartner, TRUE)){
echo 'Name: ' . $partner->Name;
echo 'Country: ' . $partner->Country;
}
echo $partner->Id;
}
echo "<br><br>";
}