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