- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$header = "asd.ads./ads.test+dsa";
#$header = "";
#$header = 123;
$header = 'application/vnd.ez.api.test+jSon';
#$name = 'hello [*kitty*],how good is today';
preg_match( '/application\/vnd\.ez\.api\.(.*)\+(?:json|xml)/i', $header, $match );
var_dump( $match );