user2338816
0
Q:

php remove iteration from array

<?php 
  
// Declare an array and initialize it 
$Array = array( 
    "GeeksForGeeks_1",  
    "GeeksForGeeks_2",  
    "GeeksForGeeks_3"
); 
  
// Display the array elements 
print_r($Array); 
  
// Use foreach loop to remove array element 
foreach($Array as $k => $val) { 
    if($val == "GeeksForGeeks_3") { 
        unset($Array[$k]); 
    } 
} 
  
// Display the array elements 
print_r($Array); 
  
?> 
0
unset( $variable )
0

New to Communities?

Join the community