我使用簡單的HTML DOM解析器,並用這個我能得到所有的輸入標籤的對象片斷如下從HTML用了preg_replace
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);
}
,但沒有成功刪除輸入大小....
任何幫助將appriciated ...
唯唯諾諾的人其工作謝謝,我不知道簡單的解析器有很多感謝的能力一噸 –