を含むテキスト ファイル (testfile.txt) を取得しました。
127.0.0.1:80
127.0.0.1:90
127.0.0.1:100 127.0.0.1:230
127.0.0.1:110
127.0.0.1:200
127.0.0.1:201 127.0.0.1:45
127.0.0.1:86
(...)
127.0.0.1:100 127.0.0.1:230 や 127.0.0.1:201127.0.0.1:45 などの行を修正するために、次のスクリプトを使用しています (POST METHOD):
$listValue = "";
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
if(!empty($_POST['list']))
$res = preg_match_all("/\d+\.\d+\.\d+\.\d+\:\d+/", $_POST['list'], $match);
if($res)
foreach($match[0] as $value)
$listValue .= $value."\n";
送信時:
echo trim($listValue);
スクリプトは次を返します。
127.0.0.1:80
127.0.0.1:90
127.0.0.1:100
127.0.0.1:230
127.0.0.1:110
127.0.0.1:200
127.0.0.1:201
127.0.0.1:86
(...)
testfile.txt から読み取り、testfile.txt に保存するには、このスクリプトが必要です。何か案は?乾杯