30秒学会 PHP 片段 – memoize
Returns the memoized (cached) function. Create an empty cache by instantiating a new array. Return a...
Returns the memoized (cached) function. Create an empty cache by instantiating a new array. Return a...
Returns true if the given string is lower case, false otherwise. Convert the given string to lower c...
Returns the first string there is between the strings from the parameter $start and $end. Use trim()...
Calculates the greatest common divisor between two or more numbers. Use recursion. Use array_reduce(...
Generates an array, containing the Fibonacci sequence, up until the nth term. Create an empty array,...
Check if a string starts with a given substring. Use strpos() to find the position of $needle in $ha...
Returns the last element for which the provided function returns a truthy value. Use array_filter() ...
Filters out the elements of an array, that have one of the specified values. Use array_values() and ...
Flattens an array up to the one level depth. Use array_push(), splat operator and array_values() to ...
Returns true if the given number is even, false otherwise. Checks whether a number is odd or even us...