- print_r: documentation ( source)
- explode: documentation ( source)
- array_filter: documentation ( source)
- preg_replace: documentation ( source)
<?php
$allowedAttachmentTypes = '.jpeg,.gif,.png,.jpg,.bmp';
$allowedAttachmentTypes = array_filter( explode( ',', $allowedAttachmentTypes ), function( $var )
{
return preg_replace( '#[\s\.]+#', '', $var );
} );
print_r( $allowedAttachmentTypes );