30秒学会 PHP 片段 – drop
Returns a new array with $n elements removed from the left. Use array_slice() to remove $n elements ...
Returns a new array with $n elements removed from the left. Use array_slice() to remove $n elements ...
Returns the maximum value from the provided array. Use array_filter() and max() to find the maximum ...
Returns the median of an array of numbers. Find the middle of the array, use sort() to sort the valu...
Returns true if the provided function returns true for all elements of an array, false otherwise. Us...
Checks if a string is ends with a given substring. Use strrpos() in combination with strlen to find ...
Returns the index of the last element for which the provided function returns a truthy value. Use ar...
Clamps $num within the inclusive range specified by the boundary values $a and $b. If $num falls wit...
Compare two strings and returns true if both strings are anagram, false otherwise. Use count_chars()...
Converts a string to a URL-friendly slug. Uses preg_replace() to replace invalid chars with dashes, ...
Deep flattens an array. Use recursion. Use array_push, splat operator and an empty array to flatten ...