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"));
 }