<?php
require_once __DIR__ . '/functions.php';

$cat = " na2t5u25re spo12r54t funn82y cake2! 8sea au#!tumn!";
$cat_temp = parseCategories($cat);

$categories = [];
foreach ($cat_temp as $cat) {
    $digits  = preg_replace('/\D/', '', $cat);
    $letters = preg_replace('/[^a-zA-Z]/', '', $cat);
    $random = random_int(1000, 5000);

    $categories[$random + intval($digits)] = $letters;
}
ksort($categories);

var_dump($categories);