Ell20 Posted December 18, 2007 Share Posted December 18, 2007 Hi, I have a variable at the moment called $name which contain a name of someone for example "Ryan Giggs". Is there anyway in which I can split that variable into 2? e.g $first = "Ryan" and $last = "Giggs" Thanks for your help Link to comment https://forums.phpfreaks.com/topic/82178-solved-split-variable-into-2/ Share on other sites More sharing options...
rajivgonsalves Posted December 18, 2007 Share Posted December 18, 2007 Yes. list ($first,$last) = explode(" ",$name); Link to comment https://forums.phpfreaks.com/topic/82178-solved-split-variable-into-2/#findComment-417567 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.