[PHP] 배열값을 조회하고 없으면 밀어넣기.
$temp = "e";$aaa = "a-b-c-d";$arr_aaa = explode('-',$aaa);if (!array_search($temp, $arr_aaa)){ array_push($arr_aaa, $temp); $arr_aaa = join('-', $arr_aaa);}
$temp = "e";
$aaa = "a-b-c-d";
$arr_aaa = explode('-',$aaa);
if (!array_search($temp, $arr_aaa))
{
array_push($arr_aaa, $temp);
$arr_aaa = join('-', $arr_aaa);
}