taith Posted June 9, 2006 Share Posted June 9, 2006 hey all, just wanting a simple way to split a variable... wanting something like<?$v1{3}$v2{3}$v3{4} = $variable;?>but i doubt its that simple... Quote Link to comment https://forums.phpfreaks.com/topic/11584-splitting-variables/ Share on other sites More sharing options...
Fyorl Posted June 9, 2006 Share Posted June 9, 2006 I don't know exactly what you mean but you can use $variable = explode('|', $var); which splits a string by the | character and puts each section in an array. $v1{3} will get you the 4th character in a string. Doing $variable = $v1{3} . $v2{3} . $v3{4]; will do what you put above Quote Link to comment https://forums.phpfreaks.com/topic/11584-splitting-variables/#findComment-43655 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.