Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $emp_file = "/occ/data/xml/directory-results.xml";
- $emp=simplexml_load_file($emp_file);
- $last = '';
- $first = '';
- $resLast = $emp->xpath("//person[contains(translate(last, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'".strtolower($last)."')]");
- $resFirst = $emp->xpath("//person[contains(translate(first, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'".strtolower($first)."')]");
- $resAll = array_merge($resLast,$resFirst);
- foreach ($resLast as $p) {
- $x = (int)$p->pidm;
- $Lpidm[$x] = (int)$p->pidm;
- $lastName[$x] = $p->last;
- $firstName[$x] = $p->first;
- }
- foreach ($resFirst as $p) {
- $x = (int)$p->pidm;
- $Fpidm[$x] = (int)$p->pidm;
- $lastName[$x] = $p->last;
- $firstName[$x] = $p->first;
- }
- $pidm = array_intersect($Lpidm, $Fpidm);
- foreach ($pidm as $i) {
- echo $lastName[$i].", ";
- echo $firstName[$i]."\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment