Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function extract_str($string, $start, $end) {
  2.      $pos = stripos($string, $start);
  3.      $str = substr($string, $pos);
  4.      $str_two = substr($str, strlen($start));
  5.      $second_pos = stripos($str_two, $end);
  6.      $str_three = substr($str_two, 0, $second_pos);
  7.      return trim($str_three);;      
  8.  }
  9.  
  10.  // output: pitung
  11.  extract_str('77pitung.', '77', '.');