@@ 901-911 (lines=11) @@ | ||
898 | * @param string $postcode array of values |
|
899 | * @return string[] Array of postcodes with wildcards |
|
900 | */ |
|
901 | private static function _get_wildcard_postcodes( $postcode ) { |
|
902 | $postcodes = array( '*', strtoupper( $postcode ), strtoupper( $postcode ) . '*' ); |
|
903 | $postcode_length = strlen( $postcode ); |
|
904 | $wildcard_postcode = strtoupper( $postcode ); |
|
905 | ||
906 | for ( $i = 0; $i < $postcode_length; $i ++ ) { |
|
907 | $wildcard_postcode = substr( $wildcard_postcode, 0, -1 ); |
|
908 | $postcodes[] = $wildcard_postcode . '*'; |
|
909 | } |
|
910 | return $postcodes; |
|
911 | } |
|
912 | ||
913 | /** |
|
914 | * Used by admin settings page. |
@@ 124-134 (lines=11) @@ | ||
121 | * @param string $postcode array of values |
|
122 | * @return string[] Array of postcodes with wildcards |
|
123 | */ |
|
124 | private static function _get_wildcard_postcodes( $postcode ) { |
|
125 | $postcodes = array( '*', strtoupper( $postcode ), strtoupper( $postcode ) . '*' ); |
|
126 | $postcode_length = strlen( $postcode ); |
|
127 | $wildcard_postcode = strtoupper( $postcode ); |
|
128 | ||
129 | for ( $i = 0; $i < $postcode_length; $i ++ ) { |
|
130 | $wildcard_postcode = substr( $wildcard_postcode, 0, -1 ); |
|
131 | $postcodes[] = $wildcard_postcode . '*'; |
|
132 | } |
|
133 | return $postcodes; |
|
134 | } |
|
135 | ||
136 | /** |
|
137 | * Find a matching zone for a given package. |