Converting multi-dimensional array into row data
As long as this input array is static in its depth and structure, the best and fastest technique (due to lowest overhead) is to use old-school loops.
Beyond that, I would:

Not declare variable that will not be used
Use square brace pushing syntax
Avoid excessively wide lines of code which demand the developer to horizontally scroll
Use words as variable names to make your code more readable

Code: (Demo)
$final = [];
foreach ($categorizedOptions as $categories) {
    foreach ($categories as $categoryId =&gt; $category) {
        foreach ($category['attribute'] as $attributeId =&gt; $attribute) {
            foreach ($attribute['option'] as $optionId =&gt; $option) {
                $final[] = [
                    'category' =&gt; $categoryId,
                    'categoryname' =&gt; $category['name'],
                    'attribute' =&gt; $attributeId,
                    'attributename' =&gt; $attribute['name'],
                    'option' =&gt; $optionId,
                    'optionname' =&gt; $option['name']
                ];
            }
        }
    }
}

Don't worry with trying to convert this code into some sexy one-liner.  Trying to do so with recursion or nested functions will make your code ugly and negatively impact performance.
Even trying to get fancy with &quot;array destructuring&quot; and a compact() call don't look worth the effort.  (Demo)