Exemple #1
0
 /**
  * return an array of values filtered by the key ending with $endswith
  * @param $arr []
  * @param $endswith string
  * @return array
  */
 public static function filterKeyEndsWith(&$arr, $endswith)
 {
     $results = array();
     foreach ($arr as $key => $value) {
         if (Str::endsWith($key, $endswith) === true) {
             $results[$key] = $value;
         }
     }
     return $results;
 }
Exemple #2
0
 public function testEndsWithNull()
 {
     $this->assertFalse(Str::endsWith('test', null));
 }