为什么这些与$ searchtxt非常相似的代码字返回,以及以$ searchtxt开头的单词不返回。 [英] Why these code words that are very similar to the $ searchtxt returns and words that start with $ searchtxt not return.
本文介绍了为什么这些与$ searchtxt非常相似的代码字返回,以及以$ searchtxt开头的单词不返回。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?php
if(!empty($_GET['dta'])){
$searchtxt= str_replace(' ', '', $_GET['dta']);
$db=new mysqli('localhost','root','','foroosh');
$query="select Name from foroosh where Name like '".$searchtxt."%'";
$result=$db->query($query);
$number= $result->num_rows;
for($i=0;$i<$number;$i++)
{
$row=$result->FETCH_ASSOC();
echo json_encode(array("data"=>$number));
}
}
else{
}
?>
为什么这些代码字与$ searchtxt非常相似,而且以$ searchtxt开头的单词不会返回。
tnx
Why these code words that are very similar to the $ searchtxt returns and words that start with $ searchtxt not return.
tnx
推荐答案
_GET [' dta '])){
_GET['dta'])){
searchtxt = str_replace(' ' ,' ',
searchtxt= str_replace(' ', '',
_GET [< span class =code-string>' dta']);
_GET['dta']);
这篇关于为什么这些与$ searchtxt非常相似的代码字返回,以及以$ searchtxt开头的单词不返回。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文