<?php// rand_7_3.txt is a file with unique 7-digit numbers, one per line// rand_4_0.txt is a file with unique 4-digit numbers, one per line// rand_2_0.txt is a file with unique 2-digit numbers, one per line// I have 3448 7-digit numbers// I have 818 4-digit numbers// I have 90 2-digit numbers$two = file('rand_2_0.txt');$four = file('rand_4_0.txt');$seven = file('rand_7_3.txt');foreach ($two as $a) { $a = preg_replace('/\n/','', $a);}// this next bit fails.foreach ($seven as $x) { $x = preg_replace('/\n/','', $x); $nine = $x . next($two);}// what about thisforeach($two as $a){ $a = preg_replace('/\n/','', $a); foreach($seven as $x) { $x = preg_replace('/\n/','', $x); $nine = $x . next($two); }}//problem is you have to then reset back to prev() or something, //because next() moves the array pointer up one, so next time through the loop, //I believe you will have skipped a line. //Better might be to do a simple counter or while loop with join() --- jonesy?>