コード例 #1
0
ファイル: GenFunctionsTest.php プロジェクト: emijrp/Peachy
 /**
  * @dataProvider provide_strtoupper_safe
  * @covers ::strtoupper_safe
  * @param $input
  * @param $expected
  */
 public function test_strtoupper_safe($input, $expected)
 {
     $this->assertSame($expected, strtoupper_safe($input));
 }
コード例 #2
0
ファイル: GenFunctions.php プロジェクト: emijrp/Peachy
/**
 * Case insensitive in_array function
 *
 * @param mixed $needle What to search for
 * @param array $haystack Array to search in
 * @param bool $strict
 * @return bool True if $needle is found in $haystack, case insensitive
 * @link http://us3.php.net/in_array
 */
function iin_array($needle, $haystack, $strict = false)
{
    return in_array_recursive(strtoupper_safe($needle), array_map('strtoupper_safe', $haystack), $strict);
}