I was making a short little program to split a long integer into smaller bits. At the moment, what it does is simply put one digit of the int orderly into an index of $arr.
$grip = 10001; $fade = '';
for ($i = 1; $i <= trim($grip); $i++) {
$par = rand(0, 9); $fade .= "$par"; }
$arr = chunk_split($fade, 451, "\r\n");
echo $arr[1]; sleep(10);
I’m really hoping chunk_split does what I think it does and splits a string/int by a certain length…. Any help is thankfully accepted. 😀
chunk_split()doesn’t return an array, but rather a string. If you want to use it, you would have to convert the string returned bychunk_split()into an array:If you want an efficient solution though, you might want to consider something like: