Break Array

<?php
	$data = "Web development using PHP";
	
	/* Break string into array using 'explode' */
	$array = explode(" ", $data);
	var_dump($array);
	
	/* Join array into string using 'implode' */
	$string = implode(" ", $array);	
	echo "<br />".$string;
?>


/* Output */
array(4) { [0]=> string(3) "Web" [1]=> string(11) "development" [2]=> string(5) "using" [3]=> string(3) "PHP" }
Web development using PHP

Comments (0)

  • To add your comment please or

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.

Got It!