The easiest way to fix this is to delete the second time you call $thearray=array(6,8,00); Since you have already called $thearray once, you do not need to call it again, but reuse it. So to fix this, try simply deleting $thearray=array(6,8,00);