str::between($string, $start, $end)

Returns everything between two strings from the first occurrence of a given string

  • since: Kirby 2.5.0
  • $string (string)
  • $start (string)
    Character(s) to start after
  • $end (string)
    Character(s) to stop before
  • return (string)
    The part of the string between the two given strings

Example

<?php

echo str::between('string', 't', 'n');
// output: ri