Braintree\Util::delimiterToUnderscore PHP 메소드

delimiterToUnderscore() 공개 정적인 메소드

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

Usage Example

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