<?php

// Filter output data
// (remove passwords and private info)
foreach ($featured_project['user'] as $key => $value) {
    if (!in_array($key, ['id', 'name', 'image', 'user_slug', 'biography', 'website'])) {
        // We don't want to expose this field. Removing.
        unset($featured_project['user'][$key]);
    }
}
    
$out = [
    'categories' => $categories,
    'featured_project' => $featured_project,
];

echo json_encode($out);