Simple HTML DOM Parserを使用しています。これにより、以下のオブジェクトスニペットからすべての入力タグを取得できます。
foreach ($InputObj->find('input') as $e) {
$inputTag = $e->outertext;
// now I want to check if input element have size attribute then remove it with preg_replace
$inputTagsSizeStrip = preg_replace('~\<input[^\s]*size=\'|\"[^\'|\"]~is', "" , $inputTag);
}
しかし成功しません...
どんな助けでも適用されます...