I have a website (site-1) which import pages from other website (site-2).
These pages have an id number in site-2 and this number is copied to site-1 when the importing is done. So far so good.
Problem is that the id of site-2 are huge, e.g.: 32423201639, 3212450421639,... and the sistem in site-1 is no able to handle them. So I need to make these numbers smaller when the importing is done.
It is important:
to generate unique number values.
to be bigger than 3000 and smaller than 10000.
It can not use rand(). If we execute this several time the results must be the same
UPDATE: To keep in mind:
This importing is done every week, so I need to consider this: Let's say a first importing is done, and then in the second importing ONLY the first array value changes but the others remain then this one will be the only one to be changed and the other will keep the same value as in the first importing.
The first thing I thought was something like this (but the most important is missing):
$array_values_site1 = array("12345" , "123456", "1234567", "12345678", "123456789", "1234567890", "12345678901", "123456789012", "1234567890123", "12345678901234", "123456789012345", "1234567890123456");
$array_values_site2 = array();
foreach ($array_values_site1 as &$value) {
/* here I need to change the value of $value:
--- to be bigger than 3000 and smaller than 10000.
--- It can not use rand(). If we execute this several time the results must be the same
--- to be unique */
$new_value = "....";
$array_values_site2 [] = $new_value;
}
ALTER TABLE users AUTO_INCREMENT=3000;