$urlarray = array(); while ($_x = mysql_fetch_assoc($tmp)) { $urlarray[]= $_x; } $html = fopen($url, "rb");