php explode() function
Translation results:
英[ɪkˈspləʊd] US[ɪkˈsploʊd]
vi. Explode [suddenly], get angry; surge, expand rapidly
vt. (make) explode; suddenly (make a loud noise, come alive, burst out with emotions); overthrow; refute
Third person singular: explodes Present participle: exploding Past tense: exploded Past participle: exploded
php explode() functionsyntax
Function: Break up the string into an array
Syntax: explode(separator,string,limit)
Parameters:
Parameters | Description |
separator | Required . Specifies where to split the string. |
string | Required. The string to split. |
limit | Optional. Specifies the number of array elements to be returned. Possible values: greater than 0 - returns an array containing at most limit elements, less than 0 - returns an array containing all but the last -limit elements, 0 - returns an array containing one element |
Instructions: Break up the string into an array. The "separator" parameter cannot be an empty string. This function is binary safe.
php explode() functionexample
<?php $str = "Hello world. I'm study in php.cn!"; print_r (explode(".",$str)); ?>
Run instance»
Click the "Run instance" button to view the online instance
Output:
Array ( [0] => Hello world [1] => I'm study in php [2] => cn! )
<?php $arr = "Learning PHP is a good choice"; print_r(explode(" ", $arr)); ?>
Run Instance»
Click the "Run Instance" button to view the online instance
Output:
Array ( [0] => Learning [1] => PHP [2] => is [3] => a [4] => good [5] => choice )
Popular Recommendations
- Meme Coins Explode Despite Rektember Fears
- Top 5 Next Cryptocurrencies To Explode in 2024
- Top 5 Crypto Projects That May Explode Very Soon
- Top 5 Altcoins Under $1 That Could Explode in 2024
- JetBolt (JBOLT): A New Altcoin With High Growth Potential to Explode
- Next Cryptocurrency to Explode: 5 Coins to Add to Your Watchlist