I'm trying to use str_replace() to remove the "my." out of the value4 elements in an array of arrays.
However, str_replace("my.", "", $myarray); isn't changing anything.
Does str_replace() not work on two-dimensional arrays?
My sample data and coding attempt:
$array = [
[
'value1' => 'John Doe',
'value2' => 'Father',
'value3' => '',
'value4' => 'http://www.website.my.com'
],
[
'value1' => 'Jane Doe',
'value2' => 'Mother',
'value3' => '',
'value4' => 'http://www.website.my.com'
]
// ...
];
$out = str_replace('.my', '', $array);
var_export($out);