Skip to content

Instantly share code, notes, and snippets.

@Matteo182
Last active July 25, 2019 08:55
Show Gist options
  • Save Matteo182/48ee1fa4688a07866efb55d01d0b56fa to your computer and use it in GitHub Desktop.
Save Matteo182/48ee1fa4688a07866efb55d01d0b56fa to your computer and use it in GitHub Desktop.
Funzione per manipolare le stringhe
/****************************************** */
// Funzione per manipolare le stringhe
/****************************************** */
function tdm_get_string_between($string, $start, $end){
$string = ' ' . $string;
$ini = strpos($string, $start);
if ($ini == 0) return '';
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment