Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.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脚本_Php_Filter_Converter - Fatal编程技术网

代理列表过滤器php脚本

代理列表过滤器php脚本,php,filter,converter,Php,Filter,Converter,请帮帮我。 我想在我的网站上创建代理列表过滤器,但我遇到了一些问题。我希望得到代理列表的结果,比如ip:port(ex:123.456.2563:3128),但在我的脚本中,我得到了更多的空白,例如ip和port。如何将其替换为“:”字符 这是我的项目页面: 我想要这样: 很可能您根本不需要任何空格字符,为什么不str_replace(“”,,$string)?对不起,我是php新手,我必须在这里输入str_replace(“”,,$string)代码?$listValue.=str_repl

请帮帮我。 我想在我的网站上创建代理列表过滤器,但我遇到了一些问题。我希望得到代理列表的结果,比如ip:port(ex:123.456.2563:3128),但在我的脚本中,我得到了更多的空白,例如ip和port。如何将其替换为“:”字符

这是我的项目页面:

我想要这样:



很可能您根本不需要任何空格字符,为什么不
str_replace(“”,,$string)
?对不起,我是php新手,我必须在这里输入str_replace(“”,,$string)代码?
$listValue.=str_replace(“”,,$value)。“\n”非常感谢您的帮助,朋友,通过代码的轻触,这很好:$listValue.=preg_replace('/\s+/',“:”,$value)。“\n”;
<?php

$listValue = "";

    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        if(!empty($_POST['list']))
        $res = preg_match_all("/\d+\.\d+\.\d+\.\d+\s+\d+/", $_POST['list'], $match);


        if($res)
        foreach($match[0] as $value) 
        $listValue .= $value."\n";

    }

?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Enter proxy list to filter:
<br><textarea name="list" cols="50" rows="15"><?php echo trim($listValue); ?></textarea>
<p><input type="submit" value="Submit">
</form>