In PHP, what best practices should be followed when assigning unique identifiers to shapes in image maps for database queries?

When assigning unique identifiers to shapes in image maps for database queries in PHP, it is best practice to use a consistent naming convention to ensure uniqueness. One approach is to concatenate a prefix with a unique identifier, such as the shape type and an incremental number. This helps in generating unique IDs for each shape that can be easily referenced in database queries.

// Example code snippet for assigning unique identifiers to shapes in image maps
$shapes = ['circle', 'rectangle', 'polygon'];
$uniqueId = 1;

foreach ($shapes as $shape) {
    $shapeId = $shape . '_' . $uniqueId;
    
    // Store $shapeId in database along with other shape information
    
    $uniqueId++; // Increment uniqueId for the next shape
}