spiltting an array into n arrays and accessing individual arrays in php -
i have array of 1000 emails.
and want split array n arrays having 45 emails in each array.
i want separately access splitted arrays.
how can implement using php. have tried array_splice()
function in php, returns splitted arrays, unable access splitted array.
you utilize array_chunk()
in case batches of emails:
$emails = array('email1', 'email2', ..... 'email1000'); // 45 each batch $batch_emails = array_chunk($emails, 45); foreach($batch_emails $batch) { print_r($batch); } // or explicitly batch/group 5 print_r($batch_emails[4]);
php arrays
No comments:
Post a Comment