Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
Prog
/
File explorer
:
accent.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<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 ''; } } ?>