kernelgpf Posted November 23, 2007 Share Posted November 23, 2007 I need to dynamically seperate a string: it'll be in this format "1111:dragon". The number will be dynamically generated, but I need to seperate the number from the creature type after the colon and put both into seperate variables. How do I do this? Thanks! -Alyssa Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted November 23, 2007 Share Posted November 23, 2007 you need to explode that variable. more information can be found here: http://us2.php.net/manual/en/function.explode.php Quote Link to comment Share on other sites More sharing options...
kernelgpf Posted November 23, 2007 Author Share Posted November 23, 2007 The creature type will be dynamically generated, as well. ..how do I do that, php_fr3333k? I've looked in the manual, I don't understand.. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted November 23, 2007 Share Posted November 23, 2007 we need to see some code; so we know where to go from. is "creature type" this variables name? Quote Link to comment Share on other sites More sharing options...
revraz Posted November 23, 2007 Share Posted November 23, 2007 <?php $string = "1111:dragon"; $var = explode(":",$string); var_dump($var); ?> Quote Link to comment Share on other sites More sharing options...
kernelgpf Posted November 23, 2007 Author Share Posted November 23, 2007 Perfect, revraz, but I need to STORE the two values in seperate variables.. how do I do that? Quote Link to comment Share on other sites More sharing options...
kernelgpf Posted November 23, 2007 Author Share Posted November 23, 2007 Nevermind, figured it out! Thanks! Quote Link to comment 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.