Answers for "how to explode"

PHP
27

php explode

$colors  = "red,blue,green,orange";
$colorsArray = explode(",", $colors);
Posted by: Guest on June-14-2019
2

php explode

$list = "one,two,three";
$sep_char = ",";
// array of all needed items: "one", "two", "three"
$arr = explode($sep_char, $list);
// array of max two items: "one", "two,three"
$arr = explode($sep_char, $list, 2);
Posted by: Guest on February-17-2021
1

php explode

<?php
 // php explode function => converting text into array 
$str = "Hello world. It's a beautiful day.";
print_r (explode(" ",$str)); // here we define space for breaking we can change space with particular, commna or etc
// results ['hello','world.','It's','a','beautiful','day.']

?>
Posted by: Guest on August-24-2021

Browse Popular Code Answers by Language