I'm trying to remove a key and value from an array, the thing is that i dont know where its located in the array (can be in random places - but only ONCE!) i found some posts here but seems like none of them could help my problem or i just didnt understood how it works:
PHP array delete by value (not key)
PHP using preg_match or regex as value for array_search or the key for array_keys_exist
the first link acctually worked for me, but the value cannot be regex and only static value.
anyone knows how i can remove from my array its key and it's value with regex? for example:
array1 = (dany,hello,tamtam,gogo,remove1)
expected array:
array1 = (dany,hello,tamtam,gogo)
after finishing with the first array its being unset
array1 = (lion,dear,damdam,lalala,remove2)
expected array:
array1 = (lion,dear,damdam,lalala)
Thanks in advance.