eugene2009 Posted February 27, 2010 Share Posted February 27, 2010 very simple.. i just want to know the simplest way to do it.. how would i split a 10 digit number.... i.e. 5952324843 into 3 variables.. say if its a phone number and i want them to be split into characters of 3, 3, and 4. ($var1, $var2, $var3 ) thank you Link to comment https://forums.phpfreaks.com/topic/193554-splitting-variables/ Share on other sites More sharing options...
jskywalker Posted February 27, 2010 Share Posted February 27, 2010 $a=5952324843; print substr($a,0,3); print substr($a,3,3); print substr($a,6,4); Link to comment https://forums.phpfreaks.com/topic/193554-splitting-variables/#findComment-1018913 Share on other sites More sharing options...
eugene2009 Posted February 27, 2010 Author Share Posted February 27, 2010 thank you! works great! Link to comment https://forums.phpfreaks.com/topic/193554-splitting-variables/#findComment-1018915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.