Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

find value from array and remove array element in php

<?php
	$arr = array('Sam','Kin','Alex','Dineal');
  if(in_array('Sam',$arr)){
    unset($arr[array_search('Sam',$arr)]);
  }
  print_r($arr);
?>

Array
(
    [1] => Kin
    [2] => Alex
    [3] => Dineal
)
Source by onecompiler.com #
 
PREVIOUS NEXT
Tagged: #find #array #remove #array #element #php
ADD COMMENT
Topic
Name
7+2 =