私は名前のリストを持っているページtest.phpを持っています:
name1='992345'
name2='332345'
name3='558645'
name4='434544'
別のページtest1.php?id=name2
では、結果は次のようになります。
332345
私はこのPHPコードを試しました:
<?php
$Text=file_get_contents("test.php")
$id = $_GET["id"];
;preg_match_all('/$id.=\'([^\']+)\'/',$Text,$Match);
$fid=$Match[1][0];
echo $fid; ?>
コードがこのように使用されている場合
<?php
$Text=file_get_contents("test.php")
;preg_match_all('/name3=\'([^\']+)\'/',$Text,$Match);
$fid=$Match[1][0];
echo $fid; ?>
結果は良好です
558645
しかし、結果が bee の場合、このように GET メソッドで'/name3=\'
fromの名前を変更できるようにしたいです。;preg_match_all('/name3=\'([^\']+)\'/',$Text,$Match)
test1.php?id=name4
434544