Instance
en_US International Format:
The above code will output:
The price is USD 1,234.56
Definition and usage
The Money_format () function returns a string formatted as a currency string.
The function inserts a formatted number in the percent (%)
Here are 11 web scenarios where you can take advantage of Redis's features to improve efficiency.
1. Displays the most recent list of items in the home page.
Redis uses a cache of resident memory, which is very fast. Lpush is used to insert a
Instance
Returns a string that contains all the different characters used in "Hello world!" (Mode 3):
Definition and usage
The Count_chars () function returns information about the characters used in the string (for example, the number of times an
Instance
Returns an array in ascending order:
Definition and usage
The Array_multisort () function returns a sorted array. You can enter one or more arrays. The function first sorts the first array, then the other arrays, and if two or more values
Instance
Filter the elements in the array with a callback function:
Definition and usage
The Array_filter () function filters the elements in the array with a callback function.
This function passes each key value in the input array to the callback
Instance
Fills the array with the key value of the given key name:
Definition and usage
The Array_fill_keys () function fills an array with the key value given by the specified key name.
Grammar
Array_fill_keys (Keys,value);
Parameters
Delete the first element in the array (red) and return the element that was deleted:
Definition and usage
The Array_shift () function deletes the first element in the array and returns the element that was deleted.
Note: If the key name is numeric,
Definition and usage
The Array_replace () function replaces the value of the first array with the value of the following array.
Tip: You can pass an array, or multiple arrays, to a function.
If a key exists in the first array array1 also exists in
Random extraction is the element of the original array is scrambled after output, which means that after each execution, the extraction sequence or elements are different, the function can be used to display a different advertisement on the Web page
Array_map the callback function to the cell of the given array
Array Array_map (callable $callback, array $arr 1 [, Array $ ...]
The Array_map () function functions The user-defined function to each value in the array and returns an array with the
This article mainly introduces the PHP data structure of the linked list queue information, hope that through this article can help everyone, the need for friends can refer to the next
PHP Linked list queue
Instance code:
Class queue{private $last;
This article mainly introduces the PHP two-dimensional array fast sorting algorithm implementation code related information, hope that through this article can help everyone, let everyone realize this function, the need for friends can refer to the
Instance
Searches for the position of "world" in the string and returns all characters from that position to the end of the string:
Definition and usage
The STRRCHR () function finds the last occurrence of a string in another string and returns all
PHP type conversion, constants, system constants, magic constants of the detailed
1. automatic type conversion;
In the operation and judgment, automatic type conversion is performed, 1) other types are converted to bool, and the conversion is
Instance
Find the location where "PHP" first appears in the string:
Definition and usage
The Stripos () function finds the position of the first occurrence of a string in another string (case insensitive).
Note: the Stripos () function is case
array array_count_values (array $input) Array_count_values () returns an array that uses the value in the input array as the key name, the number of occurrences in the input array as the value. count the number of occurrences of all values in the
Instance
Find the first occurrence of "world" in "Hello world!" and return the remainder of the string:
Definition and usage
The STRCHR () function searches for the first occurrence of a string in another string.
The function is an alias of the
Instance
Randomly disrupts all characters in a string:
Definition and usage
The Str_shuffle () function randomly scrambles all characters in a string.
Grammar
Str_shuffle (String)
Parameters
Describe
String
Necessary.
Instance
Calculate the Soundex key for "Hello":
Definition and usage
The SOUNDEX () function computes the Soundex key for the string.
The Soundex key is an alphanumeric string of 4 characters, representing the English pronunciation of a word.
The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service