Braintree\Util::delimiterToUnderscore PHP Méthode

delimiterToUnderscore() public static méthode

convert alpha-beta-gamma to alpha_beta_gamma
public static delimiterToUnderscore ( string $string ) : string
$string string
Résultat string modified string
    public static function delimiterToUnderscore($string)
    {
        return preg_replace('/-/', '_', $string);
    }

Usage Example

 public function testDelimeterToUnderscore()
 {
     $this->assertEquals("a_b_c", Braintree\Util::delimiterToUnderscore("a-b-c"));
 }