Random Selection of String Value

From: Mike Lepore (lepor5e_at_bestweb.net)
Date: 10/30/04


Date: Sat, 30 Oct 2004 03:19:59 -0400

Please tell me how I can randomly select a string from a limited set
of string, and then use it in links.

With equal probability, suppose half the time I want
to form a link to domain.com/1234/page.htm and half the time I
want to link to domain.com/5678/page.htm . I would like to be
able to put something into my link such as:
domain.com/<?php ... WHAT GOES HERE? ... ?>/page.htm

If possible, I'd like to use a method that will put either 1234 or
5678 into a variable, so that, once it's randomly chosen for a
document sent to the browser, then numerous references to that
same string value can be used on the page.

Thank you.

--
Mike Lepore -- lepore at bestweb dot net delete the 5


Relevant Pages

  • Re: Random Selection of String Value
    ... Mike Lepore wrote: ... > Please tell me how I can randomly select a string from a limited set ... > of string, and then use it in links. ...
    (comp.lang.php)
  • Re: Random Selection of String Value
    ... > Please tell me how I can randomly select a string from a limited set ... > of string, and then use it in links. ... > With equal probability, suppose half the time I want ...
    (comp.lang.php)
  • Re: Iterate over preprocessor arguments?
    ... content in these files are string fields which can have a limited set ... my own code I check the string content and internalize an enum value. ...     else { ... You have to change your state handling code to search the state ...
    (comp.lang.c)
  • Iterate over preprocessor arguments?
    ... content in these files are string fields which can have a limited set ... my own code I check the string content and internalize an enum value. ... return AUTO; ... Python script to generate these functions, but I am reluctant to ...
    (comp.lang.c)