<?php
$attribs = ' id= "header" class = "foobar" style ="background-color:#fff; color: red; "';
$attribs = 'type="text" name="janusz" class="form-control" onclick="myFunction()"';
$x = new SimpleXMLElement("<element $attribs />");
echo '<pre>';
var_dump($x);
echo '</pre>';
?>