Expanding sizes between given values
You can use the function array_slice to take the subarray which contains the sizes from $size1 to size2. And then use implode to turn this subarray into a comma-separated string. This will simplify your algorithm.

You can also just use explode instead of substr and strstr to split the range string into its parts.

In addition I would recommend changing the variable names of $size1 and $size2. To me the name $size1 suggests that the variable contains the actual size while in fact it contains its index. Something like index_of_size1 or index_from might be more appropriate.

If I were to write this function, it'd look something like this:

function sizexpander($size_range) {
    $sizearray=Array("XS", "S", "M", "L", "XL", "XXL", "XXXL");
    list($size_from, $size_to) = explode("-", $size_range);
    $index_from = array_search($size_from, $sizearray);
    $index_to = array_search($size_to, $sizearray);
    $subsizes = array_slice($sizearray, $index_from, $index_to-$index_from+1);
    return implode(", ", $subsizes);
}