Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Array Value Find And Replace Without Loop
- $array = ['*pasta', 'cola', 'pizza'];
- $search = '*';
- $replace = '\*';
- array_walk($array,
- function (&$v) use ($search, $replace){
- $v = str_replace($search, $replace, $v);
- }
- );
- print_r($array);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement