Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自动完成不';不建议使用大写字母输入PHP和XML_Php_Autocomplete - Fatal编程技术网

自动完成不';不建议使用大写字母输入PHP和XML

自动完成不';不建议使用大写字母输入PHP和XML,php,autocomplete,Php,Autocomplete,我正在创建一个简单的表单,在这个表单中,我希望有一个自动完成功能。我阅读了本教程,并为我的数据创建了以下格式的XML文件 <inputs> <input>AA</input> <input>BAC</input> <input>AWT</input> <input>tag</input> <input>AHY</input>

我正在创建一个简单的表单,在这个表单中,我希望有一个自动完成功能。我阅读了本教程,并为我的数据创建了以下格式的XML文件

<inputs>
    <input>AA</input>
    <input>BAC</input>
    <input>AWT</input>
    <input>tag</input>
    <input>AHY</input>
</inputs>

AA
美国银行
AWT
标签
啊
处理自动完成的方法是

 $aValues = $aIndexes = array();
        $sFileData = file_get_contents('data2.xml'); // reading file content
        $oXmlParser = xml_parser_create('UTF-8');
        xml_parse_into_struct($oXmlParser, $sFileData, $aValues, $aIndexes);
        xml_parser_free( $oXmlParser );

        $aTagIndexes = $aIndexes['ITEM'];
        if (count($aTagIndexes) <= 0) exit;
        foreach($aTagIndexes as $iTagIndex) {
            $sValue = $aValues[$iTagIndex]['value'];
            if (strpos($sValue, $sParam) !== false) {
                echo $sValue . "\n";
            }
        }
    break;
$aValues=$aIndexes=array();
$sFileData=file_get_contents('data2.xml');//读取文件内容
$oXmlParser=xml\u parser\u create('UTF-8');
xml_将_解析为_结构($oXmlParser、$sFileData、$aValues、$aIndexes);
xml解析器免费($oXmlParser);
$aTagIndexes=$aIndexes['ITEM'];
如果(count($aTagIndexes)函数strpos()
区分大小写,则只返回包含字母“a”的“tag”。如果需要不区分大小写的检查,则应使用。

函数strpos()区分大小写,因此只返回包含字母“a”的“tag”。如果要进行不区分大小写的检查,则应使用