Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Docs For Class RandomUtil

Class: RandomUtil

Source Location: /pnobjlib/RandomUtil.class.php

Class Overview


RandomUtil

Methods


Inherited Variables

Inherited Methods


Class Details

[line 19] RandomUtil



[ Top ]

Class Methods


method getDate [line 282]

The getDate( startDate $startDate, endDate $endDate, [format $format = DATEFORMAT_FIXED], [seed $seed = false])

Return a random date between $startDate and $endDate



Tags:

return:  resulting random date string


Parameters:

startDate   $startDate   The lower date bound
endDate   $endDate   The high date bound
format   $format   The date format to use
seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0

[ Top ]

method getInteger [line 43]

The getInteger( floor $floor, ceil $ceil, [seed $seed = false])

Return a random integer between $floor and $ceil (inclusive)



Tags:

return:  resulting random integer


Parameters:

floor   $floor   The lower bound
ceil   $ceil   The upper bound
seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0

[ Top ]

method getParagraphs [line 224]

The getParagraphs( nParas $nParas, [dict $dict = ''], irndS $irndS, irndW $irndW, [startCustomary $startCustomary = false], [seed $seed = false])

Return a nParas paragraphs of random text based on the dictionary



Tags:

return:  resulting random date string


Parameters:

nParas   $nParas   The number of paragraphs to return to put in the sentence
dict   $dict   The dictionary to use (a space separated list of words)
irndS   $irndS   The number of sentences in a paragraph (optional) (default=0=randomlyGenerated)
irndW   $irndW   The number of words in a sentence (optional) (default=0=randomlyGenerated)
startCustomary   $startCustomary   Whether or not to start with the customary phrase (optional) (default=false)
seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0

[ Top ]

method getRandomString [line 69]

The getRandomString( length $length, [seed $seed = true])

Return a random string of specified length. This function uses uses md5() to generate the string.



Tags:

return:  resulting random integer


Parameters:

length   $length   The length of string to generate
seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0

[ Top ]

method getSeed [line 26]

The getSeed( )

Return a seed value for the srand() function



Tags:

return:  resulting seed value


[ Top ]

method getSentence [line 166]

The getSentence( nWords $nWords, dictArray $dictArray, [seed $seed = false])

Return a random sentence of nWords based on the dictionary



Tags:

return:  resulting random date string


Parameters:

nWords   $nWords   The number of words to put in the sentence
dictArray   $dictArray   The array of dictionary words to use
seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0

[ Top ]

method getString [line 102]

The getString( minLen $minLen, maxLen $maxLen, [leadingCapital $leadingCapital = true], [useUpper $useUpper = true], [useLower $useLower = true], [useSpace $useSpace = false], [useNumber $useNumber = false], [useSpecial $useSpecial = false], [seed $seed = false], [dontuse $dontuse = null])

Return a random string



Tags:

return:  resulting random string


Parameters:

minLen   $minLen   The minimum string length
maxLen   $maxLen   The maximum string length
leadingCapital   $leadingCapital   Whether or not the string should start with a capital letter (optional) (default=true)
useUpper   $useUpper   Whether or not to also use uppercase letters (optional) (default=true)
useLower   $useLower   Whether or not to also use lowercase letters (optional) (default=true)
useSpace   $useSpace   Whether or not to also use whitespace letters (optional) (default=true)
useNumber   $useNumber   Whether or not to also use numeric characters (optional) (default=false)
useSpecial   $useSpecial   Whether or not to also use special characters (optional) (default=false)
seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0
dontuse   $dontuse   Array of characters not to use (optional) (default=null) eg $dontuse=array('a', 'b', 'c');

[ Top ]

method getUserID [line 307]

The getUserID( [seed $seed = false])

Return a random user-id



Tags:

return:  resulting random user-id


Parameters:

seed   $seed   Whether or not to seed the random number generator (optional) (default=false) seeding not required for PHP>4.2.0

[ Top ]

Packages:

Files:

Classes: