Skip to content

Instantly share code, notes, and snippets.

@westonruter
Created August 16, 2024 00:15
Show Gist options
  • Save westonruter/56a13b48231098236da6b8545d82e37c to your computer and use it in GitHub Desktop.
Save westonruter/56a13b48231098236da6b8545d82e37c to your computer and use it in GitHub Desktop.
<?php
$sizes_values = array_filter(
array_map(
static function ( string $size ): string {
$size = trim( $size, " \t\f\r\n" );
$lower_sizes = strtolower( $size );
if ( 'auto' === $lower_sizes ) {
// Normalize to lower-case.
$size = $lower_sizes;
}
return $size;
},
explode( ',', $sizes )
)
);
$has_auto = isset( $sizes_values[0] ) && 'auto' === $sizes_values[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment