sprintlife Posted April 14, 2009 Share Posted April 14, 2009 Hey programmers, I wanna pull a code apart. Here is the example. 123-765432-436436 I want to pull them apart and be like this $number = '123'; // So basically pull the first set of code before the - $number2 = '765432'; // So basically pull the second set of code after the first - $number3 = '436436'; // So basically pull the third set of code after the second - I need to do this to supply to the database. Thank you! Link to comment https://forums.phpfreaks.com/topic/153969-solved-pulling-a-key-apart/ Share on other sites More sharing options...
methodlessman Posted April 14, 2009 Share Posted April 14, 2009 $str = 123-765432-435435; $breakdown = explode('-',$str); print_r($breakdown); I think that will do it. Also, http://www.php.net/explode Link to comment https://forums.phpfreaks.com/topic/153969-solved-pulling-a-key-apart/#findComment-809237 Share on other sites More sharing options...
sprintlife Posted April 14, 2009 Author Share Posted April 14, 2009 Thanks methodlessman.... I totally forgot about that code. Thanks! Link to comment https://forums.phpfreaks.com/topic/153969-solved-pulling-a-key-apart/#findComment-809242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.