this is my array output
Array ( [0] => Site=[121] [1] => #asasasas [2] => Devices=34343 [3] => DeviceID=[hjhghg])
Now I want to remove the value with key if it value contains #
symbol...
I have tried this, but does not seem to work....
foreach ($myarray as $key=>$value) {
if (strpos($value,'#') !== false) {
unset(($myarray[$key]);
}
}
any ways to fix this??
Updated this is my actual array array_values($lines)
i have already tried this...
if(strpos($value,'#') !== false) {
unset(array_values($lines)[$key]);
}