【发布时间】:2016-11-30 02:08:27
【问题描述】:
我不确定这个标题是否是这个问题的正确标题。 我的问题是.. 有一个表格,需要通过从文档中复制和粘贴来填写。
以下是我的代码:
// length of rrnNo = 12 character, could be append with spaces and start with spaces as well
$RRN = $this->input->post('rrnNo');
// do some search using $RRN
$checkRRN = strpos($text, $RRN)
if ($checkRRN !== FALSE)
{
print $text;
}
我遇到了一个错误,即当用户复制并粘贴整个 12 位数字时,没有显示搜索结果。但是当他们复制并粘贴最后 9 位数字时,他们设法得到了结果。所以我做的是..
// length of rrnNo = 12 character, could be append with spaces and start with spaces as well
$RRN = $this->input->post('rrnNo');
// get last 9 digits
$shortRRN = substr($rrn,-9);
// do some search using shortRRN
$checkRRN = strpos($text, $shortRRN)
if ($checkRRN !== FALSE)
{
print $text;
}
但仍然不适用于 12 位数字。他们仍然需要粘贴 9 位数的数据才能得到结果。感谢您的建议/意见。 谢谢
【问题讨论】:
-
这是什么语言?请标记正确的语言。
-
对不起.. 它的 php.. 谢谢
-
这听起来像是客户端问题,与 PHP 无关。使用浏览器的 F12 工具检查发送到 PHP 脚本的实际请求表单数据。
-
另外,您在 PHP 中使用什么库/框架?
$this->input->post不是 PHP 标准库的一部分。 -
我假设您在表单中使用
<textarea>标签。如果您遇到表格问题..那么也请发布 html 内容。它会变得更清晰。