3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Say we have a 74-page file $num_pages = 74; // Fill and array. $pages = range(1, $num_pages); $sections = array(); for($i = 1; $i <= $pages; $i = $i+2) { $next = $i+1; array_push($sections, "pdftk A=the.pdf cat A$i-$next output the_pages_$i-$next.pdf"); } print_r($sections);

preferences:
57.13 ms | 402 KiB | 5 Q