The explode[] function converts a string into an array by a separator, where the required parameters are delimiter and string
PHP explode[] Syntax
explode[separator, string, limit]
Where
- separator. the character that specifies breakpoints or points at which the string will be split. When this character occurs in a string, it symbolizes the end of one array element and the beginning of another
- string. the string to be split into an array
- limit [optional]. the limit specifies the number of array elements to return. The parameter can be any integer. positive, negative, or zero. If positive, the array will contain the set number of elements. If the number of elements after the delimiter split exceeds this value, the first elements remain the same, and the last element is the entire remaining string. If negative, then the last element of the array will be truncated, and the rest of the array will be returned as a single array. If zero, the returned array will contain only one element, i. e. , the entire string. If this parameter is not specified, the returned array has the total number of elements after separating the string with the separator
PHP explode[] Example
#output: Array
[
[0] => PHP
[1] => split
[2] => string
[3] => to
[4] => array
[5] => example
]
How to split a string into an array by using regular expressions in PHP?
To split a string into an array using a regular expression in PHP, you use the preg_split[] function. In the example below, we split a string at an arbitrary number of commas and whitespace characters, including the characters. " ", \r, \t, \n, and \f
PHP preg_split[] Example
#output: Array
[
[0] => Python
[1] => Java
[2] => PHP
]
How to convert a string to an array of chunks in PHP?
The str_split[] function converts a string into an array, splitting it into elements with a given number of characters. In the example below, we split the string into elements with the given number of characters - 2
PHP str_split[] Example
#output: Array
[
[0] => He
[1] => ll
[2] => o
[3] => wo
[4] => rl
[5] => d
]
See also
- How do I convert an array to a string in PHP?
- How do I replace a string in PHP?
- How can I find the length of a string in PHP?
- How to get a substring from a string using the PHP substr[] function?
- How to check if a string contains a substring in PHP?
PHP Split String Related API examples and articles
How do I send a POST request using PHP? How do I POST JSON using PHP Curl Library? How do I convert JSON to PHP array? How to check if a string contains a substring in PHP? How to post form data in PHP? How do I split a string in Python? How do I encode a PHP object to JSON string? How to get a substring from a string in PHP? How do I send a GET request using PHP? How do I convert string to lowercase in PHP? How do I compare strings in PHP? How to create a new array using PHP array_map[]?
Laravel includes a variety of global "helper" PHP functions. Many of these functions are used by the framework itself; however, you are free to use them in your own applications if you find them convenient
Available Methods
Arrays & Objects
Paths
Strings
Fluent Strings
URLs
Miscellaneous
Method Listing
Arrays & Objects
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
10
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
11 method determines if the given value is array accessibleuse Illuminate\Support\Arr;
use Illuminate\Support\Collection;
$isAccessible = Arr::accessible[['a' => 1, 'b' => 2]];
$isAccessible = Arr::accessible[new Collection];
$isAccessible = Arr::accessible['abc'];
$isAccessible = Arr::accessible[new stdClass];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
12
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
13 method adds a given key / value pair to an array if the given key doesn't already exist in the array or is set to use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
14use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
15
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
16 thu gọn một mảng các mảng thành một mảng duy nhấtuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
17
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
18 method cross joins the given arrays, returning a Cartesian product with all possible permutationsuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
19
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
20 method returns two arrays. one containing the keys and the other containing the values of the given arrayuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
21
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
22 method flattens a multi-dimensional array into a single level array that uses "dot" notation to indicate depthuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
23
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
24 method removes the given key / value pairs from an arrayuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
25
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
26 method checks that the given key exists in the provided arrayuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
27
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
28 method returns the first element of an array passing a given truth testuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
A default value may also be passed as the third parameter to the method. This value will be returned if no value passes the truth test
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
29
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
30 method flattens a multi-dimensional array into a single level arrayuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
0use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
31
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
32 xóa một cặp khóa/giá trị nhất định khỏi một mảng được lồng sâu bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
1use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
33
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
34 lấy một giá trị từ một mảng được lồng sâu bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
2Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
34 cũng chấp nhận một giá trị mặc định, giá trị này sẽ được trả về nếu khóa được chỉ định không có trong mảnguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
3use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
36
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
37 kiểm tra xem một hoặc nhiều mục đã cho có tồn tại trong một mảng hay không bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
4use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
38
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
39 kiểm tra xem có bất kỳ mục nào trong một tập hợp nhất định tồn tại trong một mảng hay không bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
5use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
40
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
41 trả về use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42 nếu mảng đã cho là một mảng kết hợp. Một mảng được coi là "kết hợp" nếu nó không có các khóa số liên tiếp bắt đầu bằng 0use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
6use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
43
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
44 trả về use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42 nếu các khóa của mảng đã cho là các số nguyên liên tiếp bắt đầu từ 0use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
7use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
46
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
47 nối các phần tử mảng với một chuỗi. Using this method's second argument, you may also specify the joining string for the final element of the arrayuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
8use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
48
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
49 method keys the array by the given key. If multiple items have the same key, only the last one will appear in the new arrayuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
9use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
50
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
51 method returns the last element of an array passing a given truth testuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
0A default value may be passed as the third argument to the method. This value will be returned if no value passes the truth test
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
1use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
52
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
53 method iterates through the array and passes each value and key to the given callback. The array value is replaced by the value returned by the callbackuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
2use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
54
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
55 method returns only the specified key / value pairs from the given arrayuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
3use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
56
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
57 method retrieves all of the values for a given key from an arrayuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
4You may also specify how you wish the resulting list to be keyed
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
5use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
58
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
59 method will push an item onto the beginning of an arrayuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
6If needed, you may specify the key that should be used for the value
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
7use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
60
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
61 prepends all key names of an associative array with the given prefixuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
8use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
62
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
63 method returns and removes a key / value pair from an arrayuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
9A default value may be passed as the third argument to the method. This value will be returned if the key doesn't exist
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
0use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
64
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
65 chuyển đổi mảng thành chuỗi truy vấnuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
1use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
66
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
67 trả về một giá trị ngẫu nhiên từ một mảnguse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
2Bạn cũng có thể chỉ định số mục sẽ trả về làm đối số thứ hai tùy chọn. Lưu ý rằng việc cung cấp đối số này sẽ trả về một mảng ngay cả khi chỉ cần một mục
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
3use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
68
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
69 đặt giá trị trong một mảng được lồng sâu bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
4use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
70
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
71 xáo trộn ngẫu nhiên các mục trong mảnguse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
5use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
72
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
73 sắp xếp một mảng theo các giá trị của nóuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
6Bạn cũng có thể sắp xếp mảng theo kết quả của một bao đóng đã cho
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
7use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
74
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
75 sắp xếp đệ quy một mảng bằng cách sử dụng hàm use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
76 cho các mảng con được lập chỉ mục bằng số và hàm use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
77 cho các mảng con kết hợpuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
8use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
78
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
79 biên dịch có điều kiện một chuỗi lớp CSS. Phương thức chấp nhận một mảng các lớp trong đó khóa mảng chứa lớp hoặc các lớp bạn muốn thêm, trong khi giá trị là một biểu thức boolean. Nếu phần tử mảng có khóa số thì nó sẽ luôn được đưa vào danh sách lớp kết xuấtuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
9Phương pháp này hỗ trợ chức năng của Laravel cho phép cũng như
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
80use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
81
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
82 mở rộng mảng một chiều sử dụng ký hiệu "dấu chấm" thành mảng nhiều chiềuuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
0use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
83
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
84 lọc một mảng bằng cách sử dụng bao đóng đã chouse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
1use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
85
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
86 loại bỏ tất cả các giá trị use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
14 khỏi mảng đã chouse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
2use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
88
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Phương thức
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
89 bọc giá trị đã cho trong một mảng. Nếu giá trị đã cho đã là một mảng, nó sẽ được trả về mà không sửa đổiuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
3Nếu giá trị đã cho là
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
14, một mảng trống sẽ được trả vềuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
4use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
91
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
The
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
92 function sets a missing value within a nested array or object using "dot" notationuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
5Hàm này cũng chấp nhận dấu hoa thị dưới dạng ký tự đại diện và sẽ điền vào mục tiêu tương ứng
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
6use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
93
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Hàm
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
94 truy xuất một giá trị từ một mảng hoặc đối tượng lồng nhau bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
7Hàm
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
94 cũng chấp nhận một giá trị mặc định, giá trị này sẽ được trả về nếu không tìm thấy khóa đã chỉ địnhuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
8Hàm này cũng chấp nhận các ký tự đại diện sử dụng dấu hoa thị, có thể nhắm mục tiêu bất kỳ khóa nào của mảng hoặc đối tượng
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
9use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
96
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Hàm
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
97 đặt giá trị trong một mảng hoặc đối tượng lồng nhau bằng cách sử dụng ký hiệu "dấu chấm"use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
0Hàm này cũng chấp nhận các ký tự đại diện sử dụng dấu hoa thị và sẽ đặt các giá trị trên mục tiêu tương ứng
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
1Theo mặc định, mọi giá trị hiện có đều bị ghi đè. Nếu bạn chỉ muốn đặt một giá trị nếu nó không tồn tại, bạn có thể chuyển
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98 làm đối số thứ tư cho hàmuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
2use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
99
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
00 trả về phần tử đầu tiên trong mảng đã chouse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
01
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
02 trả về phần tử cuối cùng trong mảng đã choPaths
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
03
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
04 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
05 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
04 để tạo đường dẫn đủ điều kiện tới tệp liên quan đến thư mục ứng dụnguse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
3use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
07
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
08 trả về đường dẫn đủ điều kiện tới thư mục gốc của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
08 để tạo đường dẫn đủ điều kiện tới một tệp nhất định liên quan đến thư mục gốc của dự ánuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
4use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
10
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
11 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
12 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
11 để tạo đường dẫn đủ điều kiện tới tệp đã cho trong thư mục cấu hình của ứng dụnguse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
5use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
14
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
15 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
16 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
15 để tạo đường dẫn đủ điều kiện tới tệp đã cho trong thư mục cơ sở dữ liệuuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
6use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
18
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
19 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
20 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
19 để tạo đường dẫn đủ điều kiện tới một tệp đã cho trong thư mụcuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
7use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
22
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
23 trả về đường dẫn đến tệp Trộn được tạo phiên bảnuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
8use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
24
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
25 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
26 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
25 để tạo đường dẫn đủ điều kiện tới một tệp đã cho trong thư mục chunguse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
9use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
28
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
29 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
30 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
29 để tạo đường dẫn đủ điều kiện tới tệp đã cho trong thư mục tài nguyênuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
0use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
32
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
33 trả về đường dẫn đủ điều kiện tới thư mục use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
34 của ứng dụng của bạn. Bạn cũng có thể sử dụng hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
33 để tạo đường dẫn đủ điều kiện tới tệp đã cho trong thư mục lưu trữuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
1Strings
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
36
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
37 dịch chuỗi dịch đã cho hoặc khóa dịch bằng các tệp bản địa hóa của bạnuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
2Nếu chuỗi hoặc khóa dịch được chỉ định không tồn tại, hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
37 sẽ trả về giá trị đã cho. Vì vậy, sử dụng ví dụ trên, hàm use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
37 sẽ trả về use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
40 nếu khóa dịch đó không tồn tạiuse Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
41
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
42 trả về tên lớp của lớp đã cho với không gian tên của lớp đã bị xóause Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
3use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
43
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
44 function runs PHP's use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
45 function with the use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
46 option set to use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42 by defaultuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
4use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
48
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
49 function replaces a given pattern in the string sequentially using an arrayuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
5use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
50
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
51 method returns everything after the given value in a string. The entire string will be returned if the value does not exist within the stringuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
6use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
52
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
53 method returns everything after the last occurrence of the given value in a string. The entire string will be returned if the value does not exist within the stringuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
7use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
54
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
55 method will attempt to transliterate the string into an ASCII valueuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
8use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
56
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
57 method returns everything before the given value in a stringuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
9use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
58
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
59 method returns everything before the last occurrence of the given value in a stringuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
0use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
60
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
61 method returns the portion of a string between two valuesuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
1use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
62
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
63 method returns the smallest possible portion of a string between two valuesuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
2use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
64
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
65 method converts the given string to use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
66use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
3use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
67
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
68 method determines if the given string contains the given value. This method is case sensitiveuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
4You may also pass an array of values to determine if the given string contains any of the values in the array
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
5use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
69
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
70 method determines if the given string contains all of the values in a given arrayuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
6use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
71
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
72 method determines if the given string ends with the given valueuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
7You may also pass an array of values to determine if the given string ends with any of the values in the array
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
8use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
73
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
74 method extracts an excerpt from a given string that matches the first instance of a phrase within that stringuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
9The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
75 option, which defaults to use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
76, allows you to define the number of characters that should appear on each side of the truncated stringIn addition, you may use the
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
77 option to define the string that will be prepended and appended to the truncated stringuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
0use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
78
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
79 method adds a single instance of the given value to a string if it does not already end with that valueuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
1use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
80
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
81 sẽ chuyển đổi các chuỗi được phân tách bằng chữ hoa, dấu gạch ngang hoặc dấu gạch dưới thành một chuỗi được phân cách bằng dấu cách với chữ cái đầu tiên của mỗi từ được viết hoause Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
2use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
82
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương pháp
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
83 chuyển đổi Markdown có hương vị GitHub thành HTML nội tuyến bằng CommonMark. Tuy nhiên, không giống như phương thức use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
84, nó không bao bọc tất cả HTML được tạo trong phần tử cấp khốiuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
3use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
85
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
86 xác định xem một chuỗi đã cho có khớp với một mẫu nhất định hay không. Dấu hoa thị có thể được sử dụng làm giá trị ký tự đại diệnuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
4use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
87
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
88 xác định xem một chuỗi đã cho có phải là ASCII 7 bit hay khônguse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
5use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
89
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
90 xác định xem chuỗi đã cho có phải là JSON hợp lệ hay khônguse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
6use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
91
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
92 xác định xem chuỗi đã cho có phải là ULID hợp lệ hay khônguse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
7use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
93
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
94 xác định xem chuỗi đã cho có phải là một UUID hợp lệ hay khônguse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
8use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
95
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
96 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
97use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
9use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
98
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương thức
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
99 trả về chuỗi đã cho với ký tự đầu tiên là chữ thườnguse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
0use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
00
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
01 method returns the length of the given stringuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
1use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
02
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
03 cắt ngắn chuỗi đã cho theo độ dài đã chỉ địnhuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
2Bạn có thể chuyển đối số thứ ba cho phương thức để thay đổi chuỗi sẽ được thêm vào cuối chuỗi bị cắt bớt
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
3use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
04
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
05 chuyển đổi chuỗi đã cho thành chữ thườnguse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
4use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
06
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương pháp
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
07 chuyển đổi Markdown có hương vị GitHub thành HTML bằng CommonMarkuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
5use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
08
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
09 che giấu một phần của chuỗi có ký tự lặp lại và có thể được sử dụng để làm xáo trộn các phân đoạn của chuỗi như địa chỉ email và số điện thoạiuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
8Nếu cần, bạn cung cấp một số âm làm đối số thứ ba cho phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
10, điều này sẽ hướng dẫn phương thức bắt đầu tạo mặt nạ ở khoảng cách nhất định tính từ cuối chuỗiuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
11
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
12 tạo UUID "dấu thời gian trước" có thể được lưu trữ hiệu quả trong cột cơ sở dữ liệu được lập chỉ mục. Mỗi UUID được tạo bằng phương pháp này sẽ được sắp xếp sau các UUID được tạo trước đó bằng phương pháp nàyuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
7use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
13
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
14 bao bọc hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
15 của PHP, đệm cả hai bên của một chuỗi bằng một chuỗi khác cho đến khi chuỗi cuối cùng đạt đến độ dài mong muốnuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
8use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
16
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
17 bao bọc hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
15 của PHP, đệm phía bên trái của một chuỗi bằng một chuỗi khác cho đến khi chuỗi cuối cùng đạt đến độ dài mong muốnuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
9use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
19
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
20 bao bọc hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
15 của PHP, đệm bên phải của một chuỗi bằng một chuỗi khác cho đến khi chuỗi cuối cùng đạt đến độ dài mong muốnuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
00use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
22
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
23 chuyển đổi một chuỗi từ số ít sang dạng số nhiều của nó. Chức năng này hỗ trợuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
01Bạn có thể cung cấp một số nguyên làm đối số thứ hai cho hàm để truy xuất dạng số ít hoặc số nhiều của chuỗi
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
02use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
24
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
25 chuyển đổi một chuỗi từ số ít được định dạng trong trường hợp viết hoa thành dạng số nhiều của nó. Chức năng này hỗ trợuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
03Bạn có thể cung cấp một số nguyên làm đối số thứ hai cho hàm để truy xuất dạng số ít hoặc số nhiều của chuỗi
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
04use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
26
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
27 tạo ra một chuỗi ngẫu nhiên có độ dài được chỉ định. Hàm này sử dụng hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
28 của PHPuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
8use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
29
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
30 xóa giá trị đã cho hoặc mảng giá trị khỏi chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
06Bạn cũng có thể chuyển
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98 làm đối số thứ ba cho phương thức use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
32 để bỏ qua trường hợp khi xóa chuỗiuse Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
33
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
34 thay thế một chuỗi đã cho trong chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
07use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
35
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
36 thay thế một giá trị nhất định trong chuỗi theo tuần tự bằng cách sử dụng một mảnguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
08use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
37
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
38 thay thế lần xuất hiện đầu tiên của một giá trị đã cho trong một chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
09use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
39
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
40 thay thế lần xuất hiện cuối cùng của một giá trị đã cho trong một chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
10use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
41
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
42 đảo ngược chuỗi đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
11use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
43
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
44 chuyển đổi một chuỗi thành dạng số ít của nó. Chức năng này hỗ trợuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
12use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
45
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
46 tạo ra một "slug" thân thiện với URL từ chuỗi đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
13use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
47
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
48 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
49use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
14use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
50
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
51 loại bỏ tất cả khoảng trắng không liên quan khỏi một chuỗi, bao gồm cả khoảng trắng không liên quan giữa các từuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
15use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
52
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
53 thêm một thể hiện duy nhất của giá trị đã cho vào một chuỗi nếu nó chưa bắt đầu với giá trị đóuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
16use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
54
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
55 xác định xem chuỗi đã cho có bắt đầu bằng giá trị đã cho hay khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
17Nếu một mảng các giá trị có thể được truyền vào, phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
56 sẽ trả về use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42 nếu chuỗi bắt đầu bằng bất kỳ giá trị nào đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
18use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
58
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
59 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
60use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
19use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
61
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
62 trả về phần chuỗi được chỉ định bởi tham số bắt đầu và độ dàiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
20use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
63
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
64 method returns the number of occurrences of a given value in the given stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
21use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
65
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
66 thay thế văn bản trong một phần của chuỗi, bắt đầu từ vị trí được chỉ định bởi đối số thứ ba và thay thế số lượng ký tự được chỉ định bởi đối số thứ tư. Truyền use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
67 cho đối số thứ tư của phương thức sẽ chèn chuỗi vào vị trí đã chỉ định mà không thay thế bất kỳ ký tự hiện có nào trong chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
22use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
68
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
69 thay thế nhiều giá trị trong chuỗi đã cho bằng cách sử dụng hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
70 của PHPuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
23use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
71
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
72 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
73use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
24use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
74
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
75 method converts the string instance to an instance of use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
76, which may be displayed in Blade templatesuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
25use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
77
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
78 method returns the given string with the first character capitalizeduse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
26use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
79
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
80 method splits the given string into an array by uppercase charactersuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
27use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
81
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
82 method converts the given string to uppercaseuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
28use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
83
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
84 method generates a ULIDuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
29use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
85
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
86 method generates a UUID [version 4]use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
30use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
87
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
88 method returns the number of words that a string containsuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
31use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
89
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
90 method limits the number of words in a string. An additional string may be passed to this method via its third argument to specify which string should be appended to the end of the truncated stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
32use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
91
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
92 function returns a new use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
93 instance of the given string. This function is equivalent to the use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
94 methoduse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
33If no argument is provided to the
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
92 function, the function returns an instance of use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
96use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
34use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
97
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
98 function translates the given translation key using your localization filesuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
35If the specified translation key does not exist, the
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
98 function will return the given key. So, using the example above, the use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
98 function would return use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
40 if the translation key does not existuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
02
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
03 function translates the given translation key with inflectionuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
36If the specified translation key does not exist, the
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
03 function will return the given key. So, using the example above, the use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
03 function would return use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
06 if the translation key does not existFluent Strings
Fluent strings provide a more fluent, object-oriented interface for working with string values, allowing you to chain multiple string operations together using a more readable syntax compared to traditional string operations
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
07
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
07 method returns everything after the given value in a string. The entire string will be returned if the value does not exist within the stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
37use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
09
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
09 method returns everything after the last occurrence of the given value in a string. The entire string will be returned if the value does not exist within the stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
38use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
11
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
11 method appends the given values to the stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
39use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
13
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
13 method will attempt to transliterate the string into an ASCII valueuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
40use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
15
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
15 method will return the trailing name component of the given stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
41If needed, you may provide an "extension" that will be removed from the trailing component
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
42use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
17
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
17 method returns everything before the given value in a stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
43use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
19
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
19 method returns everything before the last occurrence of the given value in a stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
44use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
21
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
21 method returns the portion of a string between two valuesuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
45use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
23
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
23 method returns the smallest possible portion of a string between two valuesuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
46use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
25
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
25 method converts the given string to use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
66use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
47use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
28
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
28 method returns the class name of the given class with the class's namespace removeduse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
48use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
30
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
30 method determines if the given string contains the given value. This method is case sensitiveuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
49You may also pass an array of values to determine if the given string contains any of the values in the array
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
50use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
32
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
32 method determines if the given string contains all of the values in the given arrayuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
51use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
34
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
34 method returns the parent directory portion of the given stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
52If necessary, you may specify how many directory levels you wish to trim from the string
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
53use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
36
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
36 method extracts an excerpt from the string that matches the first instance of a phrase within that stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
54The
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
75 option, which defaults to use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
76, allows you to define the number of characters that should appear on each side of the truncated stringIn addition, you may use the
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
77 option to change the string that will be prepended and appended to the truncated stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
55use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
41
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
41 method determines if the given string ends with the given valueuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
56You may also pass an array of values to determine if the given string ends with any of the values in the array
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
57use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
43
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
43 method determines if the given string is an exact match with another stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
58use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
45
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
45 method splits the string by the given delimiter and returns a collection containing each section of the split stringuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
59use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
47
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
47 method adds a single instance of the given value to a string if it does not already end with that valueuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
60use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
49
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
49 method will convert strings delimited by casing, hyphens, or underscores into a space delimited string with each word's first letter capitalizeduse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
61use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
51
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
The
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
51 method converts GitHub flavored Markdown into inline HTML using CommonMark. However, unlike the use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
84 method, it does not wrap all generated HTML in a block-level elementuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
62Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
54 xác định xem một chuỗi đã cho có khớp với một mẫu nhất định hay không. Dấu hoa thị có thể được sử dụng làm giá trị ký tự đại diệnuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
63use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
55
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
55 xác định xem một chuỗi đã cho có phải là chuỗi ASCII hay khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
64use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
57
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
57 xác định xem chuỗi đã cho có trống khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
65use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
59
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
59 xác định xem chuỗi đã cho có trống khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
66use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
61
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
61 xác định xem một chuỗi đã cho có phải là JSON hợp lệ hay khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
67use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
63
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
63 xác định xem một chuỗi đã cho có phải là ULID hay khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
68use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
65
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
65 xác định xem một chuỗi đã cho có phải là UUID hay khônguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
69use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
67
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
67 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
97use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
70use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
70
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
70 trả về chuỗi đã cho với ký tự đầu tiên là chữ thườnguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
71use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
72
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
72 trả về độ dài của chuỗi đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
72use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
74
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
74 cắt ngắn chuỗi đã cho theo độ dài đã chỉ địnhuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
73Bạn cũng có thể chuyển đối số thứ hai để thay đổi chuỗi sẽ được thêm vào cuối chuỗi bị cắt bớt
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
74use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
76
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
76 chuyển đổi chuỗi đã cho thành chữ thườnguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
75use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
78
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
78 cắt bỏ phần bên trái của chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
76use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
84
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
Phương pháp
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
84 chuyển đổi Markdown có hương vị GitHub thành HTMLuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
77use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
10
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
10 che giấu một phần của chuỗi có ký tự lặp lại và có thể được sử dụng để làm xáo trộn các phân đoạn của chuỗi như địa chỉ email và số điện thoạiuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
8Nếu cần, bạn cung cấp một số âm làm đối số thứ ba cho phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
10, điều này sẽ hướng dẫn phương thức bắt đầu tạo mặt nạ ở khoảng cách nhất định tính từ cuối chuỗiuse Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
85
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
85 sẽ trả về phần của chuỗi khớp với mẫu biểu thức chính quy đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
79use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
87
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
87 sẽ trả về một tập hợp chứa các phần của chuỗi khớp với mẫu biểu thức chính quy đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
80Nếu bạn chỉ định một nhóm phù hợp trong biểu thức, Laravel sẽ trả về một tập hợp các kết quả phù hợp của nhóm đó
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
81Nếu không tìm thấy kết quả phù hợp, một bộ sưu tập trống sẽ được trả về
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
89
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
89 nối thêm ký tự "cuối dòng" vào một chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
82use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
91
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
91 bao bọc hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
15 của PHP, đệm cả hai bên của một chuỗi bằng một chuỗi khác cho đến khi chuỗi cuối cùng đạt đến độ dài mong muốnuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
83use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
94
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
94 bao bọc hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
15 của PHP, đệm phía bên trái của một chuỗi bằng một chuỗi khác cho đến khi chuỗi cuối cùng đạt đến độ dài mong muốnuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
84use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
97
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100];
$filtered = Arr::except[$array, ['price']];
97 bao bọc hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
15 của PHP, đệm vào bên phải của một chuỗi bằng một chuỗi khác cho đến khi chuỗi cuối cùng đạt đến độ dài mong muốnuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
85use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
00
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
00 cho phép bạn chuyển đổi chuỗi bằng cách chuyển giá trị hiện tại của nó sang giá trị có thể gọi đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
86use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
02
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
02 chuyển đổi một chuỗi từ số ít sang dạng số nhiều của nó. Chức năng này hỗ trợuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
87Bạn có thể cung cấp một số nguyên làm đối số thứ hai cho hàm để truy xuất dạng số ít hoặc số nhiều của chuỗi
use Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
88use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
04
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
04 thêm các giá trị đã cho vào chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
89use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
32
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
Phương thức
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
32 xóa giá trị đã cho hoặc mảng giá trị khỏi chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
90Bạn cũng có thể chuyển
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98 làm tham số thứ hai để bỏ qua trường hợp khi xóa chuỗiuse Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
09
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
09 thay thế một chuỗi đã cho trong chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
91use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
11
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
11 thay thế một giá trị đã cho trong chuỗi theo tuần tự bằng cách sử dụng một mảnguse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
92use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
13
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
13 thay thế lần xuất hiện đầu tiên của một giá trị đã cho trong một chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
93use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
15
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
15 thay thế lần xuất hiện cuối cùng của một giá trị đã cho trong một chuỗiuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
94use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
17
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
17 thay thế tất cả các phần của chuỗi khớp với mẫu bằng chuỗi thay thế đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
95Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
17 cũng chấp nhận một bao đóng sẽ được gọi với mỗi phần của chuỗi khớp với mẫu đã cho, cho phép bạn thực hiện logic thay thế trong bao đóng và trả về giá trị được thay thếuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
96use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
20
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
20 cắt bỏ phía bên phải của chuỗi đã chouse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
97use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
22
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
22 phân tích cú pháp đầu vào từ một chuỗi thành một bộ sưu tập theo định dạng được hỗ trợ bởi hàm use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
24 PHPuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
98use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
25
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
25 chuyển đổi một chuỗi thành dạng số ít của nó. Chức năng này hỗ trợuse Illuminate\Support\Arr;
$array = Arr::add[['name' => 'Desk'], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
$array = Arr::add[['name' => 'Desk', 'price' => null], 'price', 100];
// ['name' => 'Desk', 'price' => 100]
99use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
27
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
27 tạo ra một "slug" thân thiện với URL từ chuỗi đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
00use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
29
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
29 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
49use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
01use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
32
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
32 tách một chuỗi thành một tập hợp bằng biểu thức chính quyuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
02use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
34
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
34 loại bỏ tất cả khoảng trắng không liên quan khỏi một chuỗi, bao gồm cả khoảng trắng không liên quan giữa các từuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
03use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
36
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
36 thêm một thể hiện duy nhất của giá trị đã cho vào một chuỗi nếu nó chưa bắt đầu với giá trị đóuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
04use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
56
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
The
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
56 method determines if the given string begins with the given valueuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
05use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
40
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
40 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
60use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
06use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
43
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
43 trả về phần của chuỗi được chỉ định bởi các tham số bắt đầu và độ dài đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
07use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
45
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
45 thay thế văn bản trong một phần của chuỗi, bắt đầu từ vị trí được chỉ định bởi đối số thứ hai và thay thế số lượng ký tự được chỉ định bởi đối số thứ ba. Truyền use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
67 cho đối số thứ ba của phương thức sẽ chèn chuỗi vào vị trí đã chỉ định mà không thay thế bất kỳ ký tự hiện có nào trong chuỗiuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
08use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
48
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
48 thay thế nhiều giá trị trong chuỗi bằng cách sử dụng hàm use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
70 của PHPuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
09use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 chuyển chuỗi đến bao đóng đã cho, cho phép bạn kiểm tra và tương tác với chuỗi trong khi không ảnh hưởng đến chính chuỗi đó. Chuỗi ban đầu được trả về bởi phương thức use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 bất kể giá trị được trả về bởi bao đónguse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
10use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
54
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
54 xác định xem một chuỗi có khớp với mẫu biểu thức chính quy đã cho hay khônguse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
11use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
56
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
56 chuyển đổi chuỗi đã cho thành use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot[$array];
// ['products.desk.price' => 100]
73use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
12use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
59
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
59 cắt chuỗi đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
13use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
61
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
61 trả về chuỗi đã cho với ký tự đầu tiên được viết hoause Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
14use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
63
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
63 tách chuỗi đã cho thành một tập hợp bằng các ký tự viết hoause Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
15use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
65
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
65 chuyển đổi chuỗi đã cho thành chữ hoause Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
16use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
67
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
67 gọi bao đóng đã cho nếu một điều kiện đã cho là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
17Nếu cần, bạn có thể chuyển một bao đóng khác làm tham số thứ ba cho phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
67. Lệnh đóng này sẽ thực thi nếu tham số điều kiện ước tính là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
72
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
72 gọi bao đóng đã cho nếu chuỗi chứa giá trị đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
18Nếu cần, bạn có thể chuyển một bao đóng khác làm tham số thứ ba cho phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
67. Việc đóng này sẽ thực hiện nếu chuỗi không chứa giá trị đã choYou may also pass an array of values to determine if the given string contains any of the values in the array
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
19use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
75
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
75 gọi bao đóng đã cho nếu chuỗi chứa tất cả các chuỗi con đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
20Nếu cần, bạn có thể chuyển một bao đóng khác làm tham số thứ ba cho phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
67. Lệnh đóng này sẽ thực thi nếu tham số điều kiện ước tính là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
79
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
79 gọi bao đóng đã cho nếu chuỗi trống. Nếu bao đóng trả về một giá trị, thì giá trị đó cũng sẽ được trả về bằng phương thức use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
79. Nếu bao đóng không trả về giá trị, thể hiện chuỗi thông thạo sẽ được trả vềuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
21use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
82
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
82 gọi bao đóng đã cho nếu chuỗi không trống. Nếu bao đóng trả về một giá trị, thì giá trị đó cũng sẽ được trả về bằng phương thức use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
82. Nếu bao đóng không trả về giá trị, thể hiện chuỗi thông thạo sẽ được trả vềuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
22use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
85
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
85 gọi bao đóng đã cho nếu chuỗi bắt đầu bằng chuỗi con đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
23use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
87
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
87 gọi bao đóng đã cho nếu chuỗi kết thúc bằng chuỗi con đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
24use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
89
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
89 gọi bao đóng đã cho nếu chuỗi khớp chính xác với chuỗi đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
25use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
91
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
91 gọi bao đóng đã cho nếu chuỗi không khớp chính xác với chuỗi đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
26use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
93
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
93 gọi bao đóng đã cho nếu chuỗi khớp với một mẫu nhất định. Dấu hoa thị có thể được sử dụng làm giá trị ký tự đại diện. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
27use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
95
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
95 gọi bao đóng đã cho nếu chuỗi là 7 bit ASCII. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
28use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
97
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
97 gọi bao đóng đã cho nếu chuỗi là ULID hợp lệ. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
29use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
99
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
Phương thức
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
99 gọi bao đóng đã cho nếu chuỗi là UUID hợp lệ. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
30use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
01
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Phương thức
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
01 gọi bao đóng đã cho nếu chuỗi khớp với biểu thức chính quy đã cho. Việc đóng cửa sẽ nhận được thể hiện chuỗi thông thạouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
31use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
03
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Phương thức
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
03 trả về số từ mà một chuỗi chứause Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
32use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
05
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Phương pháp
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
05 giới hạn số lượng từ trong một chuỗi. Nếu cần, bạn có thể chỉ định một chuỗi bổ sung sẽ được thêm vào chuỗi đã cắt bớtuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
33URLs
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
07
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
08 tạo URL cho hành động của bộ điều khiển đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
34Nếu phương thức chấp nhận tham số tuyến đường, bạn có thể chuyển chúng làm đối số thứ hai cho phương thức
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
35use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
09
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
10 tạo URL cho nội dung bằng cách sử dụng lược đồ hiện tại của yêu cầu [HTTP hoặc HTTPS]use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
36Bạn có thể định cấu hình máy chủ URL nội dung bằng cách đặt biến
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
11 trong tệp use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
12 của mình. Điều này có thể hữu ích nếu bạn lưu trữ nội dung của mình trên một dịch vụ bên ngoài như Amazon S3 hoặc CDN khácuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
37use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
13
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
14 tạo một URL cho mộtuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
38Nếu tuyến chấp nhận tham số, bạn có thể chuyển chúng làm đối số thứ hai cho hàm
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
39Theo mặc định, hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
14 tạo một URL tuyệt đối. Nếu bạn muốn tạo một URL tương đối, bạn có thể chuyển use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98 làm đối số thứ ba cho hàmuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
40use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
17
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
18 tạo URL cho nội dung bằng HTTPSuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
41use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
19
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
20 tạo URL HTTPS đủ điều kiện cho đường dẫn đã cho. Các phân đoạn URL bổ sung có thể được chuyển vào đối số thứ hai của hàmuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
42use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
21
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
22 tạo một giá trị cho trướcuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
43Nếu cần, bạn có thể chuyển mã trạng thái HTTP sẽ được gán cho chuyển hướng và bất kỳ tiêu đề phản hồi bổ sung nào làm đối số thứ ba và thứ tư cho phương thức
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
22use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
44use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
24
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
25 tạo một URL đủ điều kiện cho đường dẫn đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
45Nếu không có đường dẫn nào được cung cấp, một phiên bản
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
26 được trả vềuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
46Miscellaneous
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
27
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm ném
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
28 sẽ được hiển thị bởiBạn cũng có thể cung cấp thông báo ngoại lệ và tiêu đề phản hồi HTTP tùy chỉnh sẽ được gửi tới trình duyệt
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
47use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
29
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
30 đưa ra một ngoại lệ HTTP nếu một biểu thức boolean đã cho có giá trị là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
48Giống như phương pháp
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
28, bạn cũng có thể cung cấp văn bản phản hồi của ngoại lệ làm đối số thứ ba và một mảng các tiêu đề phản hồi tùy chỉnh làm đối số thứ tư cho hàmuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
33
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
34 đưa ra một ngoại lệ HTTP nếu một biểu thức boolean đã cho có giá trị là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
49Giống như phương pháp
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
28, bạn cũng có thể cung cấp văn bản phản hồi của ngoại lệ làm đối số thứ ba và một mảng các tiêu đề phản hồi tùy chỉnh làm đối số thứ tư cho hàmuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
37
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
05 trả về phiên bản bộ chứa dịch vụBạn có thể chuyển một lớp hoặc tên giao diện để giải quyết nó từ vùng chứa
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
50use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
39
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
40 trả về một phiên bản xác thực. Bạn có thể sử dụng nó thay thế cho mặt tiền use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
41Nếu cần, bạn có thể chỉ định phiên bản bảo vệ nào bạn muốn truy cập
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
51use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
42
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
43 tạo một vị trí trước đó của người dùnguse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
52use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
44
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
45 băm giá trị đã cho bằng Bcrypt. Bạn có thể sử dụng chức năng này thay thế cho mặt tiền use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
46use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
53use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
47
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
48 xác định xem giá trị đã cho có phải là "trống" hay khôngĐối với nghịch đảo của
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
48, hãy xem phương phápuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
51
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
52 phát sự kiện đã cho tới người nghe của nóuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
54use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
53
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
54 có thể được sử dụng để lấy các giá trị từ bộ đệm. Nếu khóa đã cho không tồn tại trong bộ đệm, một giá trị mặc định tùy chọn sẽ được trả vềuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
55Bạn có thể thêm các mục vào bộ đệm bằng cách chuyển một mảng các cặp khóa/giá trị cho hàm. Bạn cũng nên chuyển số giây hoặc thời lượng mà giá trị được lưu trong bộ nhớ cache sẽ được coi là hợp lệ
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
56use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
55
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
56 trả về tất cả các đặc điểm được sử dụng bởi một lớp, bao gồm các đặc điểm được sử dụng bởi tất cả các lớp cha của nóuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
57use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
57
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
58 tạo một thể hiện tập hợp từ giá trị đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
58use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
59
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
[$keys, $values] = Arr::divide[['name' => 'Desk']];
12 nhận giá trị của một biến cấu hình. Các giá trị cấu hình có thể được truy cập bằng cú pháp "chấm", bao gồm tên của tệp và tùy chọn bạn muốn truy cập. Giá trị mặc định có thể được chỉ định và được trả về nếu tùy chọn cấu hình không tồn tạiuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
59Bạn có thể đặt các biến cấu hình trong thời gian chạy bằng cách chuyển một mảng các cặp khóa/giá trị. Tuy nhiên, lưu ý rằng chức năng này chỉ ảnh hưởng đến giá trị cấu hình cho yêu cầu hiện tại và không cập nhật giá trị cấu hình thực tế của bạn
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
60use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
61
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
62 tạo một thể hiện mớiuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
61use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
63
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
64 tạo trường đầu vào HTML use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
65 chứa giá trị của mã thông báo CSRF. Ví dụ: sử dụng cú pháp Bladeuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
66
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
67 lấy giá trị của CSRF token hiện tạiuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
68
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
69 giải mã giá trị đã cho. Bạn có thể sử dụng chức năng này thay thế cho mặt tiền use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
70use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
62use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
71
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
72 kết xuất các biến đã cho và kết thúc thực thi tập lệnhuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
63Nếu bạn không muốn tạm dừng thực thi tập lệnh của mình, hãy sử dụng chức năng này để thay thế
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
74
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
75 đẩy cái đã cho vào hàng đợi công việc của Laraveluse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
64use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
76
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
73 kết xuất các biến đã chouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
65Nếu bạn muốn dừng thực thi tập lệnh sau khi kết xuất các biến, hãy sử dụng hàm để thay thế
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
79
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
80 mã hóa giá trị đã cho. Bạn có thể sử dụng chức năng này thay thế cho mặt tiền use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
70use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
66use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
82
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
83 lấy giá trị của một hoặc trả về một giá trị mặc địnhuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
67Cảnh báo
Nếu bạn thực thi lệnh84 trong quá trình triển khai của mình, bạn nên đảm bảo rằng bạn chỉ đang gọi hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
83 từ bên trong các tệp cấu hình của mình. Khi cấu hình đã được lưu vào bộ đệm, tệp
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
12 sẽ không được tải và tất cả các lệnh gọi hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
83 sẽ trả về
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
14
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
89
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
90 gửi sự kiện đã cho tới người nghe của nóuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
68use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
91
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
92 giải quyết một Faker singleton từ vùng chứa, có thể hữu ích khi tạo dữ liệu giả trong các nhà máy mô hình, tạo cơ sở dữ liệu, thử nghiệm và chế độ xem nguyên mẫuuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
69Theo mặc định, hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
92 sẽ sử dụng tùy chọn cấu hình use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
94 trong tệp cấu hình use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
95 của bạn; . Mỗi ngôn ngữ sẽ giải quyết một singleton riêng lẻuse Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
97
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
50 xác định xem giá trị đã cho có phải là "trống" hay khôngĐối với nghịch đảo của
use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
50, hãy xem phương phápuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
01
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
02 sẽ ghi thông tin vào nhật ký ứng dụng của bạnuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
70Một mảng dữ liệu theo ngữ cảnh cũng có thể được chuyển đến hàm
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
71use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
03
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
04 có thể được sử dụng để ghi thông báo cấp độ use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
05 vào nhật kýMột mảng dữ liệu theo ngữ cảnh cũng có thể được chuyển đến hàm
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
72Một thể hiện sẽ được trả về nếu không có giá trị nào được chuyển đến hàm
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
73use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
06
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
07 tạo trường đầu vào HTML use Illuminate\Support\Arr;
$first = Arr::first[$array, function [$value, $key] {
65 chứa giá trị giả mạo của động từ HTTP của biểu mẫu. Ví dụ: sử dụng cú pháp Bladeuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
74use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
09
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
10 tạo một phiên bản use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
11 mới cho thời điểm hiện tạiuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
12
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
13 một giá trị được đưa vào phiênuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
75Vì "giá trị mặc định" được cung cấp làm đối số thứ hai cho hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
13 thường là một thuộc tính của mô hình Eloquent, nên Laravel cho phép bạn chỉ cần chuyển toàn bộ mô hình Eloquent làm đối số thứ hai cho hàm use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
13. Khi làm như vậy, Laravel sẽ coi đối số đầu tiên được cung cấp cho hàm use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
13 là tên của thuộc tính Eloquent nên được coi là "giá trị mặc định"use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
76use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
17
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
18 chấp nhận bất kỳ đối số nào và cho phép bạn truy cập các thuộc tính hoặc gọi các phương thức trên đối tượng đó. Nếu đối tượng đã cho là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
14, các thuộc tính và phương thức sẽ trả về use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
14 thay vì gây ra lỗiuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
77Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
18 cũng chấp nhận một bao đóng làm đối số thứ hai của nó. Việc đóng sẽ được gọi nếu giá trị được cung cấp làm đối số đầu tiên không phải là nulluse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
78use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
22
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Phương thức
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
23 truy xuất một thể hiện cho một lớp nhất địnhuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
79use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
24
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
25 trả về a hoặc trả về phiên bản chuyển hướng nếu được gọi mà không có đối sốuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
80use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
26
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
27 sẽ báo cáo một ngoại lệ bằng cách sử dụngHàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
27 cũng chấp nhận một chuỗi làm đối số. Khi một chuỗi được cấp cho hàm, hàm sẽ tạo một ngoại lệ với chuỗi đã cho làm thông báo của nóuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
81use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
29
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
30 sẽ báo cáo một ngoại lệ bằng cách sử dụng của bạn nếu điều kiện đã cho là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
82use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
32
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
33 sẽ báo cáo một ngoại lệ bằng cách sử dụng của bạn nếu điều kiện đã cho là use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
83use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
35
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
36 trả về phiên bản yêu cầu hiện tại hoặc lấy giá trị của trường đầu vào từ yêu cầu hiện tạiuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
84use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
37
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
38 thực thi bao đóng đã cho và bắt mọi ngoại lệ xảy ra trong quá trình thực thi. Tất cả các ngoại lệ bị bắt sẽ được gửi đến tệp ; Bạn cũng có thể chuyển đối số thứ hai cho hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
38. Đối số này sẽ là giá trị "mặc định" sẽ được trả về nếu xảy ra ngoại lệ trong khi thực hiện đónguse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
40
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
41 phân giải một lớp hoặc tên giao diện đã cho thành một thể hiện bằng cách sử dụng bộ chứa dịch vụuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
85use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
42
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
43 tạo một phiên bản phản hồi hoặc lấy một phiên bản của nhà máy phản hồiuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
86use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
44
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
45 cố gắng thực hiện cuộc gọi lại đã cho cho đến khi đáp ứng ngưỡng lần thử tối đa nhất định. Nếu cuộc gọi lại không đưa ra một ngoại lệ, giá trị trả về của nó sẽ được trả lại. Nếu cuộc gọi lại ném một ngoại lệ, nó sẽ tự động được thử lại. Nếu vượt quá số lần thử tối đa, ngoại lệ sẽ bị némuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
87Nếu bạn muốn tính toán thủ công số mili giây để ngủ giữa các lần thử, bạn có thể chuyển một lần đóng làm đối số thứ ba cho hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
45use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
88Để thuận tiện, bạn có thể cung cấp một mảng làm đối số đầu tiên cho hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
45. Mảng này sẽ được sử dụng để xác định có bao nhiêu mili giây để ngủ giữa các lần thử tiếp theouse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
89Để chỉ thử lại trong các điều kiện cụ thể, bạn có thể chuyển một bao đóng làm đối số thứ tư cho hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
45use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
90use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
49
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
50 có thể được sử dụng để nhận hoặc đặt giá trị phiênBạn có thể đặt giá trị bằng cách chuyển một mảng các cặp khóa/giá trị cho hàm
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
91Lưu trữ phiên sẽ được trả về nếu không có giá trị nào được chuyển đến hàm
use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
92use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
51
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
Hàm
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 chấp nhận hai đối số. an arbitrary use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
53 and a closure. The use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
53 will be passed to the closure and then be returned by the use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 function. The return value of the closure is irrelevantuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
93If no closure is passed to the
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 function, you may call any method on the given use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
53. The return value of the method you call will always be use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
53, regardless of what the method actually returns in its definition. For example, the Eloquent use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
59 method typically returns an integer. However, we can force the method to return the model itself by chaining the use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
59 method call through the use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 functionuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
94To add a
use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 method to a class, you may add the use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
63 trait to the class. The use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 method of this trait accepts a Closure as its only argument. The object instance itself will be passed to the Closure and then be returned by the use Illuminate\Support\Arr;
$array = ['name' => 'John Doe', 'age' => 17];
$exists = Arr::exists[$array, 'name'];
$exists = Arr::exists[$array, 'salary'];
51 methoduse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
95use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
66
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
67 function throws the given exception if a given boolean expression evaluates to use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
42use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
96use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
69
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
70 function throws the given exception if a given boolean expression evaluates to use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
98use Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
97use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
72
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
73 function creates a new use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
11 instance for the current dateuse Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
75
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
76 function returns all traits used by a traituse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
98use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
77
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
78 function executes a closure on a given value if the value is not and then returns the return value of the closureuse Illuminate\Support\Arr;
$array = Arr::collapse[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]];
// [1, 2, 3, 4, 5, 6, 7, 8, 9]
99A default value or closure may be passed as the third argument to the function. This value will be returned if the given value is blank
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
00use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
79
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
80 function creates a new validator instance with the given arguments. You may use it as an alternative to the use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
81 facadeuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
01use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
82
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
83 function returns the value it is given. However, if you pass a closure to the function, the closure will be executed and its returned value will be returneduse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
02use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
84
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
85 function retrieves a view instanceuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
03use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
86
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
The
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
87 function returns the value it is given. If a closure is passed as the second argument to the function, the closure will be executed and its returned value will be returneduse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
04Other Utilities
Benchmarking
Sometimes you may wish to quickly test the performance of certain parts of your application. On those occasions, you may utilize the
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
88 support class to measure the number of milliseconds it takes for the given callbacks to completeuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
05By default, the given callbacks will be executed once [one iteration], and their duration will be displayed in the browser / console
To invoke a callback more than once, you may specify the number of iterations that the callback should be invoked as the second argument to the method. When executing a callback more than once, the
use Illuminate\Support\Arr;
$first = Arr::first[$array, $callback, $default];
88 class will return the average amount of milliseconds it took to execute the callback across all iterationsuse Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
06Lottery
Laravel's lottery class may be used to execute callbacks based on a set of given odds. This can be particularly useful when you only want to execute code for a percentage of your incoming requests
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
07You may combine Laravel's lottery class with other Laravel features. For example, you may wish to only report a small percentage of slow queries to your exception handler. And, since the lottery class is callable, we may pass an instance of the class into any method that accepts callables
use Illuminate\Support\Arr;
$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];
$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];
08Testing Lotteries
Laravel cung cấp một số phương thức đơn giản để cho phép bạn dễ dàng kiểm tra các yêu cầu xổ số của ứng dụng của mình