Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Array Remove By Value
- // https://stackoverflow.com/questions/8668826/search-and-replace-value-in-php-array
- $array = [
- 'p_1',
- 'p_2',
- 's_1',
- 'p_4',
- ];
- $post_remove = array('p_1', 'p_2', 'p_3', 'p_4');
- $a = array_values(array_diff($array, $remove));
- echo '<pre>', var_export($a), '</pre>';
- ?>
Add Comment
Please, Sign In to add comment