mirror of
https://github.com/getgrav/grav.git
synced 2025-11-06 05:16:07 +01:00
Added arrayLower() method
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
1. [](#new)
|
1. [](#new)
|
||||||
* Added support for custom `FormFlash` save locations
|
* Added support for custom `FormFlash` save locations
|
||||||
|
* Added a new `Utils::arrayLower()` method for lowercasing arrays
|
||||||
1. [](#improved)
|
1. [](#improved)
|
||||||
* Use new `Utils::getSupportedPageTypes()` to enforce `html,htm` at the front of the list [#2531](https://github.com/getgrav/grav/issues/2531)
|
* Use new `Utils::getSupportedPageTypes()` to enforce `html,htm` at the front of the list [#2531](https://github.com/getgrav/grav/issues/2531)
|
||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
|
|||||||
@@ -323,6 +323,17 @@ abstract class Utils
|
|||||||
return (object)array_merge((array)$obj1, (array)$obj2);
|
return (object)array_merge((array)$obj1, (array)$obj2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lowercase an entire array. Useful when combined with `in_array()`
|
||||||
|
*
|
||||||
|
* @param array $a
|
||||||
|
* @return array|false
|
||||||
|
*/
|
||||||
|
public static function arrayLower(Array $a)
|
||||||
|
{
|
||||||
|
return array_combine(array_map('strtolower', $a), $a);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple function to remove item/s in an array by value
|
* Simple function to remove item/s in an array by value
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user