Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class PH {
- public static function array_remove(&$array, $keys) {
- foreach($keys as $key){
- if( array_key_exists($key,$array) ) unset($array[$key]);
- }
- return $array;
- }
- public static function cena($cena){
- return number_format($cena,0,',','.');
- }
- public static function przedzial($cena,$koncowka = 'zł'){
- $tmp = explode('-',$cena);
- if( (int)$tmp[0] == 0 ){
- $przedzial = 'do '.self::cena($tmp[1]).' '.$koncowka;
- }elseif( $tmp[1] == 0 ){
- $przedzial = 'powyżej '.self::cena($tmp[0]).' '.$koncowka;
- }else{
- $przedzial = 'od '.self::cena($tmp[0]).' '.$koncowka.' do '.self::cena($tmp[1]).' '.$koncowka;
- }
- return $przedzial;
- }
- }
Add Comment
Please, Sign In to add comment