30秒学会 PHP 片段 – slugify
Converts a string to a URL-friendly slug. Uses preg_replace() to replace invalid chars with dashes, ...
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 ...
Returns the value of the last element in the provided collection that satisfies the provided testing...
Returns true if the given string is a palindrome, false otherwise. Convert the string to String.prot...
Maps the values of a list using a function, where the key-value pairs consist of the value as the ke...
Iterates over all own properties of an object, running a callback for each one. Use Object.keys(obj)...
Returns true if the user color scheme preference is dark, false otherwise. Use window.matchMedia() w...
Flattens a list, by spreading its elements into a new list. Loop over elements, use list.extend() if...
Tests a value, x, against a predicate function, conditionally applying a function. Check if the valu...
Checks if the predicate (second argument) is truthy on all elements of a collection (first argument)...