Conditions | 5 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | private function extractStrings($str) { |
||
19 | $pos = 0; |
||
20 | $num = 0; |
||
21 | $strings = []; |
||
22 | while (isset($str[$pos]) && ($pos = strpos($str, '"', $pos)) !== false) { |
||
23 | $end = strpos($str, '"', $pos+1); |
||
24 | if (!$end) break; |
||
25 | while ($str[$end-1] == '\\') $end = strpos($str, '"', $end+1); |
||
26 | $strings['$___STR' . ++$num] = substr($str, $pos, $end-$pos+1); |
||
27 | $str = substr_replace($str, '$___STR' . $num, $pos, $end-$pos+1); |
||
28 | } |
||
29 | |||
30 | return [$str, $strings]; |
||
31 | } |
||
32 | |||
40 | } |