Created
November 23, 2021 07:19
-
-
Save mose/b4b1ea44051e335cdf741d1e9f56ef5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach($data as $key => $row) { | |
$categories = array($row['Category']); | |
foreach($row as $h => $v) { | |
if (substr($h, 0, 3) == 'pr:') { | |
$cat = substr($h, 3); | |
if ($v != '') { | |
$categories[] = $cat; | |
} | |
unset($data[$key][$h]); | |
} | |
} | |
$data[$key]['Category'] = join(',', $categories); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment