- var_dump: documentation ( source)
- preg_match: documentation ( source)
- trim: documentation ( source)
<?php
$str = '<Location "/wtf" "yo" hello>
Allow from all
</Location>';
preg_match('/^<[\S\s]+?>/', $str, $matches);
$res = trim($matches[0], "<>");
var_dump($res );