Meta Box multi checkbox in template

This will be made in the side of the template. First get all the sizes into an array:

$allSizes = array(

    'XS' => 'Extra Small',
    'S' => 'Small',
    'M' => 'Medium',
    'L' => 'Large',
    'XL' => 'Extra Large',
    'XXL' => 'Extra Extra Large',

);

echo '<ul>';
$outStock = get_post_meta($post->ID, 'Sizes_available', true);

Then let’s compare if one of the sizes is out of stock and output accordingly:

foreach($allSizes as $key => $size){
    if(in_array($key, $outStock)){
        echo "<li><strike>$size</strike> <small>(sold out)</small></li>";
    }
    else{
        echo "<li>$size</li>";
    }
}
echo "</ul>";