php remove from array

This is very simple in php.There is function called “unset()”.Which You can use to remove array element.what you have to do is pass array name and element key to which you want to remove.

here is just simple example

    
  $arr=array(0=>'string1',1=>'string2',3=>'string3');
  unset($arr[1]);
  //will remove second element from array
  

Leave a Reply

Your email address will not be published. Required fields are marked *