The issue is that the value shows the php code instead of the placeholder, but only happens dynamically, when I test regular it works. Any thoughts or feedback how to overcome this issue?

Textbox example:

enter image description here

</div>

此问题已经存在 这里有一个答案: p>

Use Concatenation .

$p1 = '<input type="text" placeholder="name" value="' . $name . '" >';
$p2 = '<input type="text" placeholder="loc"  value="' . $loc . '" >';
echo chapterOne($p1,$p2);

You cannot start a php code block inside a php code block especially, inside quotes! If you want to use the variables for it, try this.

$p1 = <input type="text" placeholder="name" value="'.$name.'" >

相关推荐