suttercain Posted April 10, 2007 Share Posted April 10, 2007 I have this line of code: echo explode (", ", $row['characters']); But all I get is an echo of 1. When I ran the print_r it returned the array with the values. Is it possible to sort the explode array? Thanks. SC Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 10, 2007 Share Posted April 10, 2007 explode is a function, you can't echo it. explode the string into an array (that's what explode() does), then sort the array, then do whatever you want with it. array sort functions can be found in the manual at http://ca.php.net/manual/en/ref.array.php Quote Link to comment Share on other sites More sharing options...
suttercain Posted April 10, 2007 Author Share Posted April 10, 2007 Hi Andy, Thanks for the reply. I have also tried: $people = explode (", ", $row['characters']); echo sort($people); AND $people = explode (", ", $row['characters']); echo arsort($people); Both with the same results, an output of 1. Quote Link to comment Share on other sites More sharing options...
fert Posted April 10, 2007 Share Posted April 10, 2007 sort and asort either return a 1 or a 0 Quote Link to comment Share on other sites More sharing options...
suttercain Posted April 10, 2007 Author Share Posted April 10, 2007 got it, i did a foreach Thanks guys 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.