2017-05-10 15:03:04 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* ____ __ __ ____
|
|
|
|
* /\ _`\ /\ \__ /\ \__ /\ _`\
|
|
|
|
* \ \ \L\ \ __ \ \ ,_\\ \ ,_\ __ _ __ \ \ \L\_\ __ ___
|
|
|
|
* \ \ _ <' /'__`\\ \ \/ \ \ \/ /'__`\/\`'__\\ \ \L_L /'__`\ /' _ `\
|
|
|
|
* \ \ \L\ \/\ __/ \ \ \_ \ \ \_ /\ __/\ \ \/ \ \ \/, \/\ __/ /\ \/\ \
|
|
|
|
* \ \____/\ \____\ \ \__\ \ \__\\ \____\\ \_\ \ \____/\ \____\\ \_\ \_\
|
|
|
|
* \/___/ \/____/ \/__/ \/__/ \/____/ \/_/ \/___/ \/____/ \/_/\/_/
|
2017-05-11 11:29:22 +00:00
|
|
|
* Tomorrow's pocketmine generator.
|
2017-05-10 15:03:04 +00:00
|
|
|
* @author Ad5001
|
|
|
|
* @link https://github.com/Ad5001/BetterGen
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Ad5001\BetterGen\utils;
|
2017-05-11 11:29:22 +00:00
|
|
|
# Common utils under no namespace made for a specific usage
|
2017-05-10 15:03:04 +00:00
|
|
|
|
|
|
|
class CommonUtils {
|
|
|
|
/**
|
2017-05-11 11:29:22 +00:00
|
|
|
* Searches case insensitively array $haystack for $needle.
|
2017-05-10 15:03:04 +00:00
|
|
|
* src: http://php.net/manual/en/function.in-array.php#89256
|
|
|
|
* @param mixed $needle
|
|
|
|
* @param array $haystack
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
static function in_arrayi($needle, array $haystack) :bool {
|
|
|
|
return in_array(strtolower($needle), array_map('strtolower', $haystack));
|
|
|
|
}
|
|
|
|
}
|