php - echo form input field using substr_replace -


i replace character in string form input field can't seem right

if replace charcter * works fine

for ($i=1;$i<=$charsgettingremoved;$i++){ $charsremoved[$i]=substr($word,$i,1); $word = substr_replace($word,'*',$i,1);} 

however when try put in input field falls apart

for ($i=1;$i<=$charsgettingremoved;$i++){     $charsremoved[$i]=substr($word,$i,1);     $word = substr_replace($word,'<input type="text" name="question_1_letters[]" class="inputs" value="">',$i,1);} 

i missing obvious or maybe not possible using substr_replace, if give me hints on how appreciated!

many thanks!

it's not possible. can't replace string html content using function. can try add in way.

for exemple replace word 'hello' html element :

$string = "hey hello world!"; $tempstring = explode('hello',$string); $newstring = $tempstring[0] . '<strong>html element<strong>' . $tempstring[1]; 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -