Code Duplication    Length = 10-12 lines in 2 locations

class/mailsender.php 1 location

@@ 188-199 (lines=12) @@
185
			if (0 < $j)
186
			{
187
				$addr_addr = $addr_addr[1];
188
				for ($i=0; $i<$j; $i++)
189
				{
190
					//this can always find
191
					$k = strpos($to, $addr_addr[$i]);
192
					$name = substr($to, 0, $k);
193
					//prepare for next loop
194
					$to= substr($to, $k + strlen($addr_addr[$i]));
195
					//trim string we parsed out
196
					$name = trim($name, ' \t<>;,"');
197
					//gerenate addr array like address=>name style
198
					$addr[$addr_addr[$i]] = $name;
199
				}
200
				//foreach ($addr as $key=>$val)
201
				//	echo $key . '=>' . $val . "\n";
202
			}

func/string.php 1 location

@@ 635-644 (lines=10) @@
632
		// Have html tags, need split str into parts by html
633
		$ar = $ar[0];
634
		$ar_s = array();
635
		for ($i = 0; $i < count($ar); $i ++) {
636
			// Find sub str
637
			$j = strpos($str, $ar[$i]);
638
			// Add to new ar: before, tag
639
			if (0 != $j)
640
				$ar_s[] = substr($str, 0, $j);
641
			$ar_s[] = $ar[$i];
642
			// Trim origin str, so we start from 0 again next loop
643
			$str = substr($str, $j + strlen($ar[$i]));
644
		}
645
		// Tail of $str, which after html tags
646
		$ar_s[] = $str;
647