PHP Classes
elePHPant
Icontem

File: src/Transformation/DigitsOnly.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  Cipher Sweet  >  src/Transformation/DigitsOnly.php  >  Download  
File: src/Transformation/DigitsOnly.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Cipher Sweet
Encrypt data in away that can be searched
Author: By
Last change:
Date: 11 months ago
Size: 502 bytes
 

 

Contents

Class file image Download
<?php
namespace ParagonIE\CipherSweet\Transformation;

use
ParagonIE\CipherSweet\Contract\TransformationInterface;

/**
 * Class DigitsOnly
 * @package ParagonIE\CipherSweet\Transformation
 */
class DigitsOnly implements TransformationInterface
{
   
/**
     * Strips off any non-numeric characters (including periods and commas).
     *
     * @param string $input
     * @return string
     */
   
public function __invoke($input)
    {
        return \
preg_replace('/[^0-9]/', '', $input);
    }
}