示例#1
0
 function parseAllBetween($res, $start, $end)
 {
     $ret = array();
     $endPos = 0;
     do {
         $str = str::between($res, $start, $end, $endPos, true);
         if (strlen($str)) {
             $ret[] = $str;
         }
     } while ($str !== false);
     return $ret;
 }
示例#2
0
 private static function from2email($str)
 {
     // get the email between <>
     if (strstr($str, '<')) {
         $str = str::between($str, '<', '>', $pos = 0);
     }
     // get the email after the name
     if (($pos = strpos($str, ' ')) !== false) {
         $str = substr($str, 0, $pos);
     }
     $str = strtolower(trim($str));
     return $str;
 }