$cfields = array_filter(explode(",", get_option('CComment_fields')));
$Ctlds = array_filter(explode(",", get_option('Ctlds')));
Sorry, I know this is a mess. Basically I end up with two arrays: $cVal
& $Ctlds
The arrays:
$Cval = Array ( [0] => Fun Co [1] => 555-555-5555 [2] => test@test.com [3] => Tom [4] => Smith )
$Ctlds = Array ( [0] => user_company [1] => user_phone [2] => user_email [3] => user_firstname [4] => user_lastname )
I want the matching [NUMBER]
value in $Ctlds
to be the variable with the matching [NUMBER]
in $Cval
to be the value.
Example: user_company will be assigned the value Fun Co user_phone will be assigned the value 555-555-5555 etc..
This is the code I tried - bad, I know.
foreach ($Ctlds as $Ctlds){
$cVal[] = $Ctlds[];
}
I have tried code I know is waaaayy off. Any help would be appreciated. And for search reference this is USING TO ARRAYS TO CREATE VARIABLE (KEYS) AND VALUES IN PHP. Thank you so much.