- simplexml_load_string: documentation ( source)
- dom_import_simplexml: documentation ( source)
<?php
$str = '<div data-design="05" data-test="test"></div>';
$xml = simplexml_load_string($str);
$dom = dom_import_simplexml($xml);
echo $dom->getAttribute('data-design');