kryppienation Posted October 29, 2008 Share Posted October 29, 2008 I am wondering if there is a way that i can pick apart a value of a variable. I am working with a mapping system and when the info is submitted it is in the form of a regular coordinate. $location = "6-10" I need to pick the individual numbers out of that variable, ending up with 2 new variables. $newvariable1 = 6 $newvariable2 = 10 Does anyone know if it's possible to do this or not? The way that the numbers are generated into the database is in this fashion, but i need the numbers separated to do other stuff with them. Link to comment https://forums.phpfreaks.com/topic/130534-solved-need-help-_/ Share on other sites More sharing options...
asmith Posted October 29, 2008 Share Posted October 29, 2008 $newvariable = explode("-",$location); so that : $newvariable[0] = 6 $newvariable[1] = 10 Link to comment https://forums.phpfreaks.com/topic/130534-solved-need-help-_/#findComment-677197 Share on other sites More sharing options...
kryppienation Posted October 29, 2008 Author Share Posted October 29, 2008 awesome. Worked great! Thanks Link to comment https://forums.phpfreaks.com/topic/130534-solved-need-help-_/#findComment-677257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.