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 Show
PHP explode() Syntax
Where
PHP explode() 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
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
See also
PHP Split String Related API examples and articlesHow 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 MethodsArrays & ObjectsPathsStringsFluent StringsURLsMiscellaneousMethod ListingArrays & Objects
|