Created
November 4, 2019 02:06
-
-
Save egin10/7df3579c697ae63ac70617d7d7f4ac59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Core{ | |
//This method use for getting some string from long string. | |
private function getStringBetween(String $teks, String $sebelum, String $sesudah): String | |
{ | |
$teks = ' '.$teks; | |
$ini = strpos($teks, $sebelum); | |
if($ini == 0) return ''; | |
$ini += strlen($sebelum); | |
$panjang = strpos($teks, $sesudah, $ini) - $ini; | |
return substr($teks, $ini, $panjang); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment