Using two arrays:


SUBMITTED BY: henry1874w

DATE: June 23, 2017, 9:43 p.m.

FORMAT: Text only

SIZE: 219 Bytes

HITS: 351

  1. <?php
  2. function myfunction($v1,$v2)
  3. {
  4. if ($v1===$v2)
  5. {
  6. return "same";
  7. }
  8. return "different";
  9. }
  10. $a1=array("Horse","Dog","Cat");
  11. $a2=array("Cow","Dog","Rat");
  12. print_r(array_map("myfunction",$a1,$a2));
  13. ?>

comments powered by Disqus