You can assign arrays to mean different values…..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?php $databaseRow = array( 'campaignleft' => 'campaignright', 'clientleft' => 'clientright' ); $fieldNames = implode(',',array_keys($databaseRow)); $fieldValues = implode(',',array_values($databaseRow)) ; var_dump($fieldNames); //left stuff campaignleft var_dump($fieldValues); //right stuff campaignright ?> |
RESULTS: –
string(23) “campaignleft,clientleft”
string(25) “campaignright,clientright”