Jump to content

Checking for key in array...


cgm225

Recommended Posts

I need an IF statement/function that does the following: checks if an array contains a specific key, and, if so, replaces the key's value with a new provided value, but, if not, then it creates a new key (the one we were looking for)  and sets it to the new value.

 

Any ideas?  Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/117709-checking-for-key-in-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.