If I have this array: $array = ['1', '2', '3'];
I would like to replace all values in that array with asterisk sign *.
Essentially, I want to get array like this: $new = ['*', '*', '*'];.
What is the best way to do this ? I am hoping that there is some short simple solution for this.
Thanks in advance.
array_fill()@ php.netarray_walk($array, function(&$value) { $value = '*'; });$new = array_fill(0, count($array), '*');&as described in the PHP Docs