trollolodn

#php : explode number of strings and sort

Mar 27th, 2013
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. public function ExplodeListEventId($arr_eventid){
  2.     $arr_full = array();
  3.     $arr_exp = explode(",", $arr_eventid);
  4.     for ($i=0; $i < count($arr_exp); $i++) {
  5.         if($arr_exp[$i] != "" && intval($arr_exp[$i]) > 0){
  6.             if(!in_array($arr_exp[$i], $arr_full)){
  7.                 $arr_full[$i] = intval($arr_exp[$i]);
  8.             }
  9.         }
  10.     }
  11.     $arr_sorted = array_values($arr_full);
  12.     return $arr_sorted;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment