what does this function means
function entre2v2($text,$marqueurDebutLien,$marqueurFinLien)
{
$ar0=explode($marqueurDebutLien, $text);
$ar1=explode($marqueurFinLien, $ar0[1]);
$ar=trim($ar1[0]);
return $ar;
}
in above code $text refers to a text files content,which is obtained by the following code from a form post:
$text=file_get_contents($_POST['file']);
can anybody please describe about the mentioned php function?i dont understand what these two variable means
$marqueurFinLien
$marqueurDebutLien
according to first answer,I tried .But it shows error.
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
when I used the follwing:
<?
$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;
}
?>
The function appears to return the text between the
$marqueurDebutLienand$marqueurFinLienstrings from the input$text.e.g.