Explain the types of functions for Splitting String?
Answer / Indal Babu
In PHP, there are several functions to split a string. Here are a few examples:
1. str_split() - Splits a string into an array.n Example: `$string = "Hello World"; $array = str_split($string); print_r($array);`
2. explode() - Splits a string into an array by a specified delimiter.n Example: `$string = "Hello, World"; $array = explode(",", $string); print_r($array);`
3. preg_split() - Splits a string using a regular expression pattern as the delimiter.n Example: `$string = "Hello( World)"; $pattern = /( .)/; $array = preg_split($pattern, $string); print_r($array);`
| Is This Answer Correct ? | 0 Yes | 0 No |
Where is session value stored?
How can we encrypt the username and password using PHP?
3 Answers Rushmore Consultancy,
What is difference between ksort() and usort() functions.
What is polymorphism php?
What are the four scalar types of php?
Is strcmp case sensitive?
What is json php?
How to assigning a new character in a string using php?
what is the maximum size of databasi in mysql?
please can any one tell is there any openings for freshers in PHP ...please tell the company name and address sir where can i find ..php related companies and how much i expect salary as a fresher in php ..i finished my LAMP course i done my mca ..i seen in many job portals there is no job for freshers in php can any one tel me please in chennai i need php jobs ..? thank u friends
What is the current stable version of php? What advance thing in php7?
What is the purpose of constant() function?