Jump to content

[SOLVED] Can you sort(explode($variable)); ????


suttercain

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.