この関数の意味
function entre2v2($text,$marqueurDebutLien,$marqueurFinLien)
{
$ar0=explode($marqueurDebutLien, $text);
$ar1=explode($marqueurFinLien, $ar0[1]);
$ar=trim($ar1[0]);
return $ar;
}
上記のコードでは、$ textはテキストファイルのコンテンツを指します。これは、フォームの投稿から次のコードによって取得されます。
$text=file_get_contents($_POST['file']);
誰かが言及されたphp関数について説明できますか?私はこれらの2つの変数が何を意味するのか理解していません
$marqueurFinLien
$marqueurDebutLien
最初の答えによると、私は試しましたが、エラーが表示されます。
Warning: Missing argument 3 for entre2v2(), called in C:\xampp\htdocs\php\test.php on line 5 and defined in C:\xampp\htdocs\php\test.php on line 13
Notice: Undefined variable: marqueurFinLien in C:\xampp\htdocs\php\test.php on line 18
Notice: Undefined offset: 1 in C:\xampp\htdocs\php\test.php on line 18
Warning: explode() [function.explode]: Empty delimiter in C:\xampp\htdocs\php\test.php on line 18
私が以下を使用したとき:
<?
$text=file_get_contents('http://localhost/php/w.txt');
$name=entre2v2($text,"DB_USER', ',');");
echo($name);
echo("<br>");
function entre2v2($text,$marqueurDebutLien,$marqueurFinLien)
{
$ar0=explode($marqueurDebutLien, $text);
$ar1=explode($marqueurFinLien, $ar0[1]);
$ar=trim($ar1[0]);
return $ar;
}
?>