Create Array Based on Delimiter

I have a line that will output like this:

apples oranges peaches bread

I want to be able to use the values as an array based on the space delimiter " ".

printf($array[0]);
printf($array[2]);

The above prints should output something like this: apples oranges

I'm way off; I know; but hope you can help.
deharvyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
alien109Connect With a Mentor Commented:
$array = explode("apples oranges peaches bread", " ");
0
 
alien109Commented:
oops clicked submit before I wanted. It's actually reversed from that :) sorry.

$array = explode("", "apples oranges peaches bread");
0
All Courses

From novice to tech pro — start learning today.