<?php
header('Content-Type: application/json');

// Build type string programmatically
$type_str = "i" . str_repeat("s", 15) . str_repeat("d", 4) . "s";

echo json_encode([
    'type_string' => $type_str,
    'length' => strlen($type_str),
    'breakdown' => [
        'i_count' => substr_count($type_str, 'i'),
        's_count' => substr_count($type_str, 's'),
        'd_count' => substr_count($type_str, 'd')
    ]
]);
?>

