Posted By

iloveitaly on 07/09/10


Tagged

array keys implode selective chose


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

FedericoBiccheddu


Implode With Keys


 / Published in: PHP
 

  1. function implode_with_keys($sep, $array, $selection) {
  2. $temp = array();
  3.  
  4. foreach($selection as $key) {
  5. if(isset($array[$key]))
  6. $temp[] = $array[$key];
  7. }
  8.  
  9. return implode($sep, $temp);
  10. }

Report this snippet  

You need to login to post a comment.