peter.t Posted October 1, 2009 Share Posted October 1, 2009 hello, Got a rookie question for you. I've got a variable "wait.for.me". Is there a way that I can break this up into three variables? var1 = wait, var2 = for and var3 = me I'm just not sure of the terminology to search for this. Split string? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/176216-split-variable/ Share on other sites More sharing options...
akitchin Posted October 1, 2009 Share Posted October 1, 2009 you're looking for explode. Quote Link to comment https://forums.phpfreaks.com/topic/176216-split-variable/#findComment-928663 Share on other sites More sharing options...
Alex Posted October 1, 2009 Share Posted October 1, 2009 Sure, use explode() $var = 'wait.for.me'; $split = explode('.', $var); echo $split[0]; // wait echo $split[1]; // for Quote Link to comment https://forums.phpfreaks.com/topic/176216-split-variable/#findComment-928664 Share on other sites More sharing options...
peter.t Posted October 1, 2009 Author Share Posted October 1, 2009 Thanks!!! Quote Link to comment https://forums.phpfreaks.com/topic/176216-split-variable/#findComment-928673 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.