Braintree\Util::delimiterToUnderscore PHP Method

delimiterToUnderscore() public static method

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

Usage Example

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