I wanted to take the fields such as School Type, Name, Location, Details, Degreemjor, Education details, Start and End Date
How can i do this using the foreach loop
Have a look at SimpleXMLElement::attributes
I think you can get the element like
$url = 'http://recruitplushrxmlapidemo.onlineresumeparser.com/hrxml/153Melanie%20R.%20Mather%20Mills.xml';
$sxml = simplexml_load_file($url);
foreach($sxml->StructuredXMLResume->EducationHistory->SchoolOrInstitution as $key => $value){
echo 'SchoolType --> '.$value->attributes()['SchoolType'];
echo "
";
echo 'SchoolName --> '.$value->School->SchoolName;
echo "
";
echo 'SchoolLocation --> '.$value->SchoolLocation;
echo "
";
echo 'DegreeMajor --> '.$value->Degree->DegreeMajor[0];
echo "
";
echo 'EducationDetails --> '.$value->Degree->EducationDetails;
echo "
";
echo 'StartDate --> '.$value->Degree->DateofAttendance->StartDate[0];
echo "
";
echo 'EndDate --> '.$value->Degree->DateofAttendance->EndDate->AnyDate;
echo "
";
}