My [1] => Name [2] => Is ..." /> How To Split A String Into Array Using Php? My [1] => Name [2] => Is ..." /> My [1] => Name [2] => Is ..." />
Answers

Question and Answer:

  Home  PHP

⟩ How to split a string into array using php?

$myString = "My Name Is Muhammad Hussain";

$myArray = explode(' ', $myString);

print_r($myArray);

Output :

Array

(

[0] => My

[1] => Name

[2] => Is

[3] => Muhammad

[4] => Hussain

)

 196 views

More Questions for you: