Answers for ".explode"

PHP
27

php explode

$colors  = "red,blue,green,orange";
$colorsArray = explode(",", $colors);
Posted by: Guest on June-14-2019
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