Implode With Keys


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.