I have this data that i return with mysql and i add it into a list but it is very long. I want to split data into several columns using php.I am stuck here i need some ideas.One thing i know that there is jquery splitter but i want to use php how can i do it. Thanks in advance for your reply. The data is names of users but each group of users belongs to different group. If anyone need further explanation please ask me. Here is a picture for clarification
What data do you have? PHP explode() splits strings:
$input_string = 'stuff;that;should;be;split';
$delimiter = ';';
$array = explode($delimiter, $input_string);
You can use the array_chunk()
function to achieve this. It will allow you to split your array into x number of parts which you can then use to put into columns.
ie. array_chunk($input_array, 2);
This obviously assumes you are creating an array of data from your mysql recordset.