trollolodn icon

#php : explode number of strings and sort

trollolodn | PRO | 03/28/13 02:46:50 AM UTC | 0 ⭐ | 153 👁️ | Never ⏰ | []
PHP |

370 B

|

None

|

0 👍

/

0 👎

public function ExplodeListEventId($arr_eventid){
    $arr_full = array();
    $arr_exp = explode(",", $arr_eventid);
    for ($i=0; $i < count($arr_exp); $i++) {
        if($arr_exp[$i] != "" && intval($arr_exp[$i]) > 0){
            if(!in_array($arr_exp[$i], $arr_full)){
                $arr_full[$i] = intval($arr_exp[$i]);
            }
        }
    }
    $arr_sorted = array_values($arr_full);
    return $arr_sorted;
}

Comments