The TryingToScale PHP framework.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
575 B

<?php
declare(strict_types=1);
namespace tts\arrays;
final class shortn {
public static function short_street_suffix($text) {
$usps_abbreviations = [
'AVENUE' => 'Ave',
'BOULEVARD' => 'Blvd',
'DRIVE' => 'Dr',
'LANE' => 'Ln',
'MOUNT' => 'Mt',
'ROAD' => 'Rd',
'STREET' => 'St',
' NORTH ' => ' N. ',
' SOUTH ' => ' S. ',
' EAST ' => ' E. ',
' WEST ' => ' W. '
];
foreach ($usps_abbreviations as $key => $value) {
$text = str_ireplace($key, $value, $text);
}
return $text;
}
}