Posted On: Feb 22, 2018
The explode() and split() functions are used in PHP to split the strings. Both are defined here:
Split() is used to split a string into an array using a regular expression whereas explode() is used to split the string by string using the delimiter.
Example of split():
split(":", "this:is:a:split"); //returns an array that contains this, is, a, split.
Output: Array ( => this, => is, => a, => split)
Example of explode():
explode ("take", "take a explode example "); //returns an array which have value "a explode example"
Output: array( => "a explode example")
Never Miss an Articles from us.
In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...