Jump to content

[SOLVED] Splitting a string into different parts?


proud

Recommended Posts

 

$full_name="Mike Jerry Hanson";

 

I want to split this full name into 3 parts and assign each to a different variable

 

Example:

$first_name="Mike";

$mid_name="Jerry";

$last_name="Hanson";

 

Note that I don't know the $full_name string length, the only thing that separates first name, middle name and last name is the space between them.

 

To elaborate:

 

$full_name=$first_name." ".$mid_name." ".$last_name;  

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.