I need to echo Values from input fields. Preferably $var name can be same as input fieldname. Sample: echo $yesRedirect;
Should output: No
<?php
$html = array('<input type="text" name="yesRedirect" id="yesRedirectfunction" value="No">',
'<input type="text" name="noRedirect" id="noRedirectfunction" value="Yes">',
'<input type="text" name="quickcheck" id="quickcheckfunction" value="No">');
$result = array();
foreach ($html as $name) {
$dom = new DomDocument;
$dom->loadHTML($name);
var_dump($dom) . "
";
//echo $dom->getAttribute('name') . "
";
//echo $dom->getAttribute('value') . "
";
}
echo $yesRedirect; // Should output: No
echo $noRedirect; // Should output: Yes
?>
How can I simply echo input value? Is there any other way? Thank you for helping.