$neighbor = $splitxc[1]; $vcid = $splitxc[2]; # change to: $neighbor = $splitxc[1] || ''; $vcid = $splitxc[2] || '';