Làm cách nào tôi có thể tách một chuỗi theo url trong php?

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

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 accessible

use 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

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']];

14

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]

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

15

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ấ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]

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

17

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 permutations

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']];

19

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 array

use 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

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 depth

use 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

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 array

use 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

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 array

use 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

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 test

use 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

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 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]

0

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

31

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]

1

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

33

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]

2

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 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ảng

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]

3

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

36

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]

4

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

38

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]

5

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

40

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 0

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]

6

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

43

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ừ 0

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]

7

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

46

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 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]

8

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

48

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 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]

9

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

50

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 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]

0

A 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]

1

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

52

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 callback

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]

2

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

54

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 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]

3

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

56

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 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]

4

You 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]

5

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

58

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 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]

6

If 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]

7

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

60

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 prefix

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]

8

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

62

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 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]

9

A 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']];

0

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

64

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ấn

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

1

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

66

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ảng

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

2

Bạ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']];

3

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

68

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']];

4

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

70

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ảng

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

5

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

72

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']];

6

Bạ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']];

7

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

74

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ợp

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

8

use 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']];

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ất

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

9

Phươ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']];

80

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

81

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ều

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

0

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

83

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 đã cho

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

1

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

85

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 đã cho

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

2

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

88

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 đổi

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

3

Nế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']];

4

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

91

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" notation

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

5

Hà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']];

6

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

93

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']];

7

Hà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ỉ định

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

8

Hà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']];

9

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

96

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]

0

Hà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]

1

Theo 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àm

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

2

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

99

Hàm

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

00 trả về phần tử đầu tiên trong mảng đã cho

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

01

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 đã cho

Paths

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

03

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ụng

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

3

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

07

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ự án

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

4

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

10

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ụng

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

5

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

14

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ệu

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

6

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

18

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ục

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

7

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

22

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ản

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

8

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

24

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 chung

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

9

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

28

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ên

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

0

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

32

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']];

1

Strings

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

36

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ạn

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

2

Nế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ại

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

41

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óa

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

3

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

43

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 default

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

4

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

48

The

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

49 function replaces a given pattern in the string sequentially using an array

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

5

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

50

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 string

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

6

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

52

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 string

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

7

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

54

The

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

55 method will attempt to transliterate the string into an ASCII value

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

8

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

56

The

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

57 method returns everything before the given value in a string

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

9

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

58

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 string

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

0

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

60

The

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

61 method returns the portion of a string between two values

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

1

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

62

The

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

63 method returns the smallest possible portion of a string between two values

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

2

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

64

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']];

66

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

3

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

67

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 sensitive

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

4

You 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'];

5

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

69

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 array

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

6

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

71

The

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

72 method determines if the given string ends with the given value

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

7

You 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'];

8

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

73

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 string

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

9

The

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 string

In 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 string

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

0

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

78

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 value

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

1

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

80

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 hoa

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

2

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

82

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ối

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

3

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

85

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ện

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

4

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

87

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ông

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

5

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

89

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ông

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

6

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

91

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ông

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

7

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

93

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ông

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

8

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

95

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']];

97

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

9

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

98

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ường

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

0

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

00

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 string

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

1

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

02

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ỉ định

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

2

Bạ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];

3

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

04

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ường

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

4

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

06

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 CommonMark

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

5

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

08

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ại

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

8

Nế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ỗi

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

11

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ày

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

7

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

13

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ốn

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

8

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

16

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ốn

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

9

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

19

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ốn

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]

00

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

22

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]

01

Bạ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]

02

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

24

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]

03

Bạ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]

04

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

26

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 PHP

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

8

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

29

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ỗ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]

06

Bạ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ỗi

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

33

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ỗ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]

07

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

35

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ảng

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]

08

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

37

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ỗ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]

09

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

39

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ỗ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]

10

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

41

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 đã cho

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]

11

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

43

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]

12

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

45

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 đã cho

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]

13

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

47

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]

49

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]

14

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

50

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]

15

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

52

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]

16

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

54

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ông

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]

17

Nế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 đã cho

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]

18

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

58

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]

60

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]

19

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

61

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à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]

20

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

63

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 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]

21

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

65

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ỗ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]

22

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

68

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 PHP

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]

23

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

71

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]

73

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]

24

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

74

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 templates

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]

25

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

77

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 capitalized

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]

26

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

79

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 characters

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]

27

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

81

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 uppercase

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]

28

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

83

The

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

84 method generates a ULID

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]

29

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

85

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]

30

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

87

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 contains

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]

31

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

89

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 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]

32

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

91

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 method

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]

33

If 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]

96

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]

34

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

97

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 files

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]

35

If 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 exist

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

02

The

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

03 function translates the given translation key with inflection

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]

36

If 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 exist

Fluent 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

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 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]

37

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

09

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 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]

38

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

11

The

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

11 method appends the given values to 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]

39

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

13

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 value

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]

40

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

15

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 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]

41

If 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]

42

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

17

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 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]

43

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

19

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 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]

44

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

21

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 values

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]

45

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

23

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 values

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]

46

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

25

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']];

66

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]

47

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

28

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 removed

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]

48

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

30

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 sensitive

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]

49

You 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]

50

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

32

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 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]

51

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

34

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 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]

52

If 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]

53

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

36

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 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]

54

The

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 string

In 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 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]

55

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

41

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 value

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]

56

You 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]

57

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

43

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 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]

58

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

45

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 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]

59

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

47

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 value

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]

60

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

49

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 capitalized

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]

61

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

51

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 element

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]

62

Phươ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ện

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]

63

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

55

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ông

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]

64

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

57

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ông

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]

65

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

59

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ông

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]

66

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

61

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ông

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]

67

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

63

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ông

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]

68

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

65

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ông

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]

69

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

67

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']];

97

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]

70

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

70

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ường

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]

71

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

72

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 đã cho

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]

72

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

74

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ỉ định

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]

73

Bạ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]

74

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

76

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ường

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]

75

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

78

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ỗ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]

76

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide[['name' => 'Desk']];

84

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 HTML

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]

77

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

10

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ại

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

8

Nế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ỗi

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

85

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 đã cho

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]

79

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

87

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 đã cho

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]

80

Nế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]

81

Nế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

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ỗ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]

82

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

91

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ốn

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]

83

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

94

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ốn

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]

84

use Illuminate\Support\Arr;

$array = ['name' => 'Desk', 'price' => 100];

$filtered = Arr::except[$array, ['price']];

97

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ốn

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]

85

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

00

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 đã cho

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]

86

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

02

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]

87

Bạ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]

88

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

04

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ỗ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]

89

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

32

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ỗ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]

90

Bạ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ỗi

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

09

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ỗ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]

91

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

11

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ảng

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]

92

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

13

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ỗ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]

93

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

15

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ỗ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]

94

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

17

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ế đã cho

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]

95

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 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]

96

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

20

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 đã cho

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]

97

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

22

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 PHP

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]

98

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

25

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]

99

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

27

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 đã cho

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]

00

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

29

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]

49

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]

01

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

32

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 quy

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]

02

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

34

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]

03

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

36

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]

04

use Illuminate\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$flattened = Arr::dot[$array];

// ['products.desk.price' => 100]

56

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 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]

05

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

40

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]

60

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]

06

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

43

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 đã cho

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]

07

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

45

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ỗi

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]

08

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

48

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 PHP

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]

09

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

51

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 đóng

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]

10

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

54

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ông

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]

11

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

56

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]

73

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]

12

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

59

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 đã cho

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]

13

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

61

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 hoa

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]

14

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

63

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 hoa

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]

15

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

65

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ữ hoa

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]

16

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

67

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ạo

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]

17

Nế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']];

98

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

72

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ạo

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]

18

Nế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ị đã cho

You 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]

19

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

75

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ạo

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]

20

Nế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']];

98

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

79

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]

21

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

82

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]

22

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

85

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ạo

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]

23

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

87

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ạo

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]

24

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

89

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ạo

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]

25

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

91

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ạo

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]

26

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

93

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ạo

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]

27

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

95

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ạo

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]

28

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

97

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ạo

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]

29

use Illuminate\Support\Arr;

$array = ['name' => 'John Doe', 'age' => 17];

$exists = Arr::exists[$array, 'name'];

$exists = Arr::exists[$array, 'salary'];

99

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ạo

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]

30

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

01

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ạo

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]

31

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

03

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ứ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]

32

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

05

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ớ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]

33

URLs

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

07

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 đã cho

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]

34

Nế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]

35

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

09

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]

36

Bạ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á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]

37

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

13

Hàm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

14 tạo một URL cho mộ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]

38

Nế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]

39

Theo 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à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]

40

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

17

Hàm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

18 tạo URL cho nội dung bằng 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]

41

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

19

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à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]

42

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

21

Hàm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

22 tạo một giá trị cho trướ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]

43

Nế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] {

22

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]

44

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

24

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 đã cho

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]

45

Nế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]

46

Miscellaneous

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

27

Hàm ném

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

28 sẽ được hiển thị bởi

Bạ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]

47

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

29

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']];

42

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]

48

Giố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àm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

33

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']];

98

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]

49

Giố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àm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

37

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]

50

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

39

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] {

41

Nế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]

51

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

42

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ùng

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]

52

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

44

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] {

46

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]

53

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

47

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áp

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

51

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]

54

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

53

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]

55

Bạ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]

56

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

55

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]

57

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

57

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ị đã cho

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]

58

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

59

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ại

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]

59

Bạ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]

60

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

61

Hàm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

62 tạo một thể hiện mới

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]

61

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

63

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 Blade

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

66

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ại

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

68

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] {

70

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]

62

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

71

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ệ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]

63

Nế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

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 Laravel

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]

64

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

76

Hàm

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

73 kết xuất các biến đã cho

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]

65

Nế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

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] {

70

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]

66

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

82

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 đị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]

67

Cảnh báo
Nếu bạn thực thi lệnh

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

84 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;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

14

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

89

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]

68

use Illuminate\Support\Arr;

$first = Arr::first[$array, function [$value, $key] {

91

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ẫu

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]

69

Theo 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

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áp

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

01

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ạ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]

70

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]

71

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

03

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]

72

Mộ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]

73

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

06

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 Blade

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]

74

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

09

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ại

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

12

Hàm

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

13 một giá trị được đưa vào phiê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]

75

Vì "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]

76

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

17

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ỗi

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]

77

Hà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à null

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]

78

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

22

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 đị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]

79

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

24

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]

80

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

26

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ụng

Hà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]

81

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

29

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']];

42

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]

82

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

32

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']];

98

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]

83

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

35

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ại

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]

84

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

37

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 đóng

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

40

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]

85

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

42

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ồi

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]

86

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

44

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é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]

87

Nế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];

45

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]

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 theo

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]

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];

45

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]

90

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

49

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ên

Bạ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]

91

Lư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]

92

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

51

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 irrelevant

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]

93

If 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 function

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]

94

To 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 method

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]

95

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

66

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']];

42

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]

96

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

69

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']];

98

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]

97

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

72

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 date

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

75

The

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

76 function returns all traits used by a trait

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]

98

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

77

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 closure

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]

99

A 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']];

00

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

79

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 facade

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

01

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

82

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 returned

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

02

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

84

The

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

85 function retrieves a view instance

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

03

use Illuminate\Support\Arr;

$first = Arr::first[$array, $callback, $default];

86

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 returned

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

04

Other 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 complete

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

05

By 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 iterations

use Illuminate\Support\Arr;

$matrix = Arr::crossJoin[[1, 2], ['a', 'b']];

$matrix = Arr::crossJoin[[1, 2], ['a', 'b'], ['I', 'II']];

06

Lottery

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']];

07

You 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']];

08

Testing 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

How to split a URL in PHP?

How to split URL parameters in PHP?

The parameters from a URL string can be retrieved in PHP using parse_url[] and parse_str[] functions. Note. Page URL and the parameters are separated by the ? character. parse_url[] Function . The parse_url[] function is used to return the components of a URL by parsing it.

How to get current URL with query string in PHP?

To get the current page URL, PHP provides a superglobal variable $_SERVER . The $_SERVER is a built-in variable of PHP, which is used to get the current page URL. It is a superglobal variable, means it is always available in all scope.

What is URL split?

Kiểm tra phân tách hoặc Kiểm tra URL phân tách là quy trình tối ưu hóa trang web để kiểm tra các biến thể khác nhau của trang web được lưu trữ trên nhiều URL . Thử nghiệm này lấy hai hoặc nhiều biến thể của một trang web và phân chia lưu lượng truy cập trang web của bạn giữa chúng. Nó giúp xác định biến thể hoạt động tốt nhất dựa trên mục tiêu chuyển đổi của bạn.

Chủ Đề