| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public static function do($string, $locale = null) |
||
| 12 | { |
||
| 13 | //var_dump($string); exit; |
||
| 14 | if ($locale) setlocale(LC_TIME, self::convertLocale($locale)); |
||
| 15 | |||
| 16 | //var_dump(self::convertLocale($locale)); exit; |
||
| 17 | //$string = preg_replace('/date\([\'"]?([a-z% ]+)[\'"]?\)/i', strftime(strpos('\1', '%') ? '\1': '%\1'), $string); |
||
| 18 | $string = preg_replace('/date\([\'"]?%?Y[\'"]?\)/i', strftime('%Y'), $string); |
||
| 19 | $string = preg_replace('/date\([\'"]?%?(B|M)[\'"]?\)/i', strftime('%B'), $string); |
||
| 20 | $string = preg_replace('/date\([\'"]?%?A[\'"]?\)/i', strftime('%A'), $string); |
||
| 21 | $string = preg_replace('/date\([\'"]?%?e[\'"]?\)/i', strftime('%e'), $string); |
||
| 22 | |||
| 23 | return $string; |
||
| 24 | } |
||
| 36 | } |