is there any array function or some script to divide stuff? example:
1|2|3|4|5|6|7|8|9|10|11|12|13|14|15
i'm trying to divide them up into 3 so it's like:
Array 1: 1|2|3|4|5 Array 2: 6|7|8|9|10 Array 3: 11|12|13|14|15
check out the explode() function
I think [man]preg_split[/man] will help more since the result will be in array try:
$s = '1|2|3|4|5|6|7|8|9|10|11|12|13|14|15 '; $p = '/|/'; print_r(preg_split(( $p,$s,5)));
remember that patterns preg function need delimiters.
both methods so far act on string, if you have an array as said in the subject, take a look at array_slice()