I have a function like the below one that will select from the DB some different values. One of these values needs to be edited before passing the array to other functions.
The problem is that I don't know how to return the array with the edited element. How can I edit a value in the array and return the full array but with the edited element?
function eGetDashboard($eID, $pdo) {
$dashboard = PDOjoin('event', 'event.*, join_category_event.*, join_event_user.*, _dashboard.*, _dashboard_icons.*', array(
array('LEFT JOIN' => 'join_category_event', 'ON' => 'event.id_event = join_category_event.id_event'),
array('LEFT JOIN' => 'join_event_user', 'ON' => 'event.id_event = join_event_user.id_event'),
array('LEFT JOIN' => '_dashboard', 'ON' => 'join_category_event.id_category = _dashboard.id_category'),
array('LEFT JOIN' => '_dashboard_icons', 'ON' => 'join_category_event.id_category = _dashboard_icons.id_category')
), array('event.id_event' => $eID), $pdo);
foreach ($dashboard as $eDashboard)
$label = eSetDashboardLabel($eDashboard['multimedia_descr'], getLang());
return $dashboard;
}
function eSetDashboardLabel($label, $lang) {
$label = explode(";", $label);
foreach ($label as $labels) {
if (substr($labels, 1, 2) == $lang)
return substr($labels, 4);
}
}