这个功能是什么意思
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 函数吗?我不明白这两个变量是什么意思
$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;
}
?>