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 Quote 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); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.