Replace array key with new array key.

| December 10, 2009 | Reply

I found that in my model, if the table columns were not explicity set, I ran into problems. This is the block of code I used to check an options array, and replace any non explicit table columns with explicit ones.

* This block will take any option keys that do not have a table
* explicitly set, and will append the given table to them.
foreach ($options as $key=>$value){
if (!in_array($key,$keywords)){
if (!preg_match (‘/[^a-z]/i’, $key)) {
}//end if
}//end if
}//end foreach


Category: Uncategorized

About the Author ()