Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php loop array PDO remove keys

foreach($presentation as $row) {
    if(!isset($def_presentation[$row['presentation_uid']])) {
        $def_presentation[$row['presentation_uid']] = $row;
        unset($def_presentation[$row['presentation_uid']]['customfield_name'],$def_presentation[$row['presentation_uid']]['customfield_data_value']);
        $def_presentation[$row['presentation_uid']]['customfields'] = array();
    } 
    $def_presentation[$row['presentation_uid']]['customfields'][$row['customfield_name']] = $row['customfield_data_value'];
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #loop #array #PDO #remove #keys
ADD COMMENT
Topic
Name
3+3 =