<?php
$allowedAttachmentTypes = '.jpeg,.gif,.png,.jpg,.bmp';
print_r( $allowedAttachmentTypes );
$allowedAttachmentTypes = array_walk( (explode( ',', $allowedAttachmentTypes )), function( $var, $index ) use ( &$allowedAttachmentTypes )
{
$allowedAttachmentTypes[ $index ] = preg_replace( '#[\s\.]+#', '', $var );
} );
print_r( $allowedAttachmentTypes );
preferences:
39.32 ms | 402 KiB | 5 Q