I have an HTML string inside a PHP variable. The string contains several input fields. How can I get the value of an input field by its ID?
$text = '<html><head></head><body><form action="" method="post"><label>Test</label><input type="text" name="test1" id="test1" value="Value Test" /><label>Test 2</label><input type="text" name="test2" id="test2" value="Value Test2" /></form></body></html>';