【发布时间】:2014-05-23 08:43:45
【问题描述】:
每次我更新表单 textarea 时,表单都会添加一个空格。这是一个问题,因为我使用 textarea 输入为用户使用的每一行创建一个新的数组元素。
HTML:
<textarea class='form-control input-lg' name='stout' style='width:100%;min-height:200px;resize: none; '>
<?php $a = $functie- >_getFileContent('../content/stout.txt', 'j');
echo $bewerking->_extraInfoInput($a);?>
</textarea>
功能:
public function _extraInfoInput($a){
$a = preg_replace('/ /', '', $a);
return $a;
}
public function _getFileContent($file,$uitzondering){
$content = file_get_contents($file);
if($content != ''){
if($uitzondering == ''){
$a = $content.'<br/>';
}
else{
$a = $content;
}
return $a;
}
}
【问题讨论】:
-
什么是 jsfiddle.net?
-
是一个展示代码的网站。但直到现在我才看到你有 php 代码。但我认为 jsfiddle 无法运行 php 代码
标签: php html textarea whitespace