All pastes #465680 Raw Edit

Untitled

public text v1 · immutable
#465680 ·published 2007-04-30 14:31 UTC
rendered paste body


          function tep_string_to_int($string) {
            return (int)$string;
          }


        // Return a random value
          function tep_rand($min = null, $max = null) {
            static $seeded;

            if (!isset($seeded)) {
              mt_srand((double)microtime()*1000000);
              $seeded = true;
            }

            if (isset($min) && isset($max)) {
              if ($min >= $max) {
                return $min;
              } else {
                return mt_rand($min, $max);
              }
            } else {
              return mt_rand();
            }
          }


Also, I added these to the OSCommerce function library, let me know if anyone is confused on how they work and I can give a training session.

         //This will output a string
        tep_echo($string)
        {
            echo $string;
        }

        //This will use the 'addition' mathmatical function to generate the sum of two numbers when combined.
        tep_add_two_numbers_together($num1, $num2)
        {
            return ($num1 + $num2);
        }