File "accent.php"

Full Path: /home/analogde/www/Prog/File explorer/accent.php
File size: 1.28 KB
MIME-type: text/plain
Charset: utf-8

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

<?php

   // header('Content-Type: text/html; charset=ISO-8859-1');

    echo "envoi réussi ...........";

    $array = [];

    for ($x = 0; $x <= 1000; $x++) 
    {
        $array[] = "***rev_" .$x ."***"; 
    }

    print_r($array);

    $test = "***rev_785***";
    
    $key = array_search($test, $array);

    echo " ---- " .$key;

    $filename = "petit_essai_787546-5rgf" .$test ."mjml.txt";

    $str = getBetween($filename, $start = "***", $end = "***");

    echo "<br><br>";
    echo " ---- " .$str;

    /*if (str_contains($string, 'lazy')) {
        echo "The string 'lazy' was found in the string\n";
    }*/

    function getBetween($string, $start = "", $end = ""){
        if (strpos($string, $start)) { // required if $start not exist in $string
            $startCharCount = strpos($string, $start) + strlen($start);
            $firstSubStr = substr($string, $startCharCount, strlen($string));
            $endCharCount = strpos($firstSubStr, $end);
            if ($endCharCount == 0) {
                $endCharCount = strlen($firstSubStr);
            }
            return substr($firstSubStr, 0, $endCharCount);
        } else {
            return '';
        }
    }
?>