PHP Removing and Inserting Elements in an Array

$arr = explode(',',3,5,9,11);$add_value = 26;
$del_value = 9;

Inserting

if(!in_array($add_value, $arr)) {array_push($arr,$add_value);}
Array ([0] => 3[1] => 5[2] => 9[3] => 11[4] => 26)

Removing

if(in_array($del_value,$arr)) {unset ($arr[array_search($del_value,$arr)]);}
Array ([0] => 3[1] => 5[3] => 11[4] => 26)