- function extract_str($string, $start, $end) {
- $pos = stripos($string, $start);
- $str = substr($string, $pos);
- $str_two = substr($str, strlen($start));
- $second_pos = stripos($str_two, $end);
- $str_three = substr($str_two, 0, $second_pos);
- return trim($str_three);;
- }
- // output: pitung
- extract_str('77pitung.', '77', '.');