I have this script to generate static html pages for each store location the company has from a .xls list, then the script encodes urls after store location based on a keyword string.
as it is currently:
keyword_string = "key1 key2 key3 key4 key5";
function urlX($location) {
return $this->xURL($location).'/'.urlencode($this->keyword_string).'.html';
}
How can I make it read 2 or even 3 variations of the keyword_string and randomize the html urlencode?
This will create truly random links. If you wish to have a set number of keyword_string sets (ie: keyword_string_1 = “key1 key2 key3”, keyword_string_2 = “key2 key3 key1”, etc…) and choose a random set to attach to each location, this method can be used on a more simple scale. There are probably several ways to speed this up as well.
ADDED NEW:
Here’s the above code adapted to a set amount of random strings. You can pre-load additional strings and add them to the end of the
$keyword_stringArray.ADDED NEW: