How can one append an attribute to a URL in PHP without specifying its name?

When appending an attribute to a URL in PHP without specifying its name, you can use the `http_build_query()` function to build a query string with the attribute and its value. This function will automatically handle encoding the attribute and value properly. You can then append this query string to the URL using the `http_build_url()` function.

// Define the URL
$url = 'https://example.com';

// Define the attribute value
$attributeValue = '123';

// Build the query string with the attribute and its value
$queryString = http_build_query(['' => $attributeValue]);

// Append the query string to the URL
$newUrl = http_build_url($url, ['query' => $queryString]);