问题
Can anyone help me understand why a text box won't display a whole string opposed to just the first word? For example if the value of Name is "John Smith", the text box will display "John"
echo "<td>" . "<input type = text name = name value =" . $record['Name'] . " </td>" ;
回答1:
Thats because you did not quote your attribute value, without quotes spaces terminate the attribute value
echo "<td><input type = text name = name value =\"" . $record['Name'] . "\" ></td>" ;
来源:https://stackoverflow.com/questions/34466145/text-box-only-displaying-one-word-as-value