- print_r: documentation ( source)
- array_diff: documentation ( source)
<?php
$remove = '300';
$values = ['300','200','400', '500'];
//---- remove list of values (accepts array of values to remove) ----
$new = array_diff($values, (array) $remove);
print_r($new);
echo \PHP_EOL;
$values = ['200', '300', '400','500']; //move the value somewhere else;
$new = array_diff($values, (array) $remove);
print_r($new);
echo \PHP_EOL;