static public Function randstring ($len =6, $type = ', $addChars = ') {
$str = ";
Switch ($type) {
Case 0:
$chars = ' abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz '. $addChars;
Break
Case 1:
$chars = str_repeat (' 0123456789 ', 3);
Break
Case 2:
$chars = ' abcdefghijklmnopqrstuvwxyz '. $addChars;
Break
Case 3:
$chars = ' abcdefghijklmnopqrstuvwxyz '. $addChars;
Break
Case 4:
$chars = " They take me to he will do when to move domestic one is work on the annual order of the Ministry of the People can be out of the party into the great and big This is the main person in order to learn subordinate to a peer to say that the life of a lot of leather after the child self-social plus small machine also through the power line of high-volume long party to the real home fixed deep method of water physical and chemical dispute is two from the Miyoshi 10 war no agricultural and other anti-body road map to the new opening of the knot in the first Things from when the two also gifted team to the point of fertility and the inner part of the cause of the day by the pressure of the gas industry on behalf of the whole group number of fruit phase guide the basis or the moon hair, such as the shape of the heart-like dry are to turn off the question ratio exhibition that it did not look at the most and outside of the five solutions to the Lin Mi Qun head meaning only four ma-Ming Wen Tong, but the bar and the male hole leader inflow into the seat of the EQ and fly crude oil put up the problem of quality refers to the establishment of the area of the test live Hereby, often stone strong soil less has root of the total alignment of the general type of conversion nine you take the west holding the total material re-election of the concept of seven, the mountain-pass hundred more see must be true to protect the Heat committee hand to the branch has been to repair the heath a few first avoid special what type six with an indication of the return of each east of the wind back to the south-canton of the north of the road to make a car to do business by the whole set number of Levin installed, namely, the unknown axis research monochrome solid-fast anti-Slavs set up the field weaving calendar Flowers by To find out the fault condition of mining fine gold boundary products to the boundary clearance to million accurate book operation factory must be away from the re-head of the sea-right vote children green only certificate of low cross-border eight test regulation of the near-to-the-gate iron need to go to the county soldiers solid removal of the same as the lead teeth thousand wins a brief review on the leaf rate of the white lattice effect of the fine shadow in the selection of the blade ratio of the current election to the second half of the enemy began to apply sound to the recovery of the name of the red continuation of the drug mark is difficult to keep the weight of the body tight liquid of the lower dimension plate of the reduction of the base bed field Potential end sense toward God he cun structure illumination capacity not to engage in the sub-mill Group fire Section calculation of the state-of-the-Huang clothing morning wheat cutting letter row station sound of the hit Su Zhangmi hou Cao He tree fertilizer in the right side of the city of the left page anti-su show bitter British fast called bad move about Pakistan Timber Province black Wuppe Hati only needle How to implant the King eye she grabbed the side of the seedling to talk about the source of the surrounding food injection of acid old but sufficient short-stroke Xuan fall The first ruler wave bearing powder to practice the fish with the test The Mitsuo is enough to lose the pack to promote the branch of the stem Zhou Yan Division Cuschun Ultra-negative sand seal change too mold poverty reduction Yangyangiang analysis mu wood words ball toward medical school ancient rice song listen to the only to lose slip station Another Wei drum just write Liu Weilio fan for a piece of work a set of friends to limit the rest of the roll of law rain let bone far to help the first skin broadcast gifted death poison Circle Wei Ti Xun control excited to call the cloud mutual crack grain masterbatch Female practice plug steel top strategy double left wrong base suction resistance so inch shield late silk woman loose welding gong Plant Pro-school cold and wrong scattered commercial visual arts and crafts out of the 0 room light blood times the lack of the pump observation of the urban Chong-tu-tu soil simply no column Li Huanpan magnetic male like trapped Shong off delivery slave side run cover swing from the touch star Pine to receive the independence of the official mixed Ji Yi the width of the winter chapter of the wet partial grain to eat and hold the valve mine village responsibility mature steady win hard price to turn odd a pre-vocational evaluation read Back association damage cotton invasion Ash although spear thick Luo mud to inform egg box palm oxygen loving stop once dissolve camp finally outline Meng money to be full of Russian shrinkage Sand Retreat Chen to the force of the cell, the child of the stripping force of the spiral groove upside down and still ah fresh bar card coarse medium drill weak foot afraid of salt end yin Feng fog Crown Jie Lai Pui spoke intestines pay Ji infiltration Rui surprise squeeze second suspensionRotten sen sugar Sheng Tao word late silkworm billion moment Kang by the garden cavity order fragrant Meat Brother house sensitive to the production of bee urgent take spread injury flying dew Nuclear margin Rang Central Wu-hui different order free paper Night township long scribe cylinder clip read LAN Anh Ditch b Confucianism kill vapor phosphorus difficult crystal plug burn Huan Iron Supplement our Bud Yongwa Dip array Carbon Eugeshun tooth Bud Yong wa Oblique irrigation pig yang rot please go through the crisis, if the tail is strong and the enterprise vegetables Spike Chu Han more green tow cows dye both Autumn-time forging jade Summer healing Kinguizhou visit Blowing Rong Copper along for the rollers to call the dry understanding thorn brain in the possession of the furnace shell sulfur coal ying casting sticking to the light of the good and blessing of the choice of the Reyen, the pure gradually tillage run ze slowly planted Rutch the mixed tide cross-cut cone Hitch defeat ship false bright means that the Zhehwai cut pendulum tribute to the strength of the money instrument shen Lian ma sin ancestral car wear cargo pin Zimping draw feed Dragon Storehouse keep build room song Han Xi elder brother wash eclipse waste na abdomen by the record mirror women Zhong risk Praise clock shake the handle Bamboo Valley sell Chaos Bridge Ober to catch up the Wall net cross-section of the Road to hang a lesson town in the way of resistance to the aid of the Fu Qing gather around Mo busy dance encounter So Gu gum yanghu nail tone trace broken extension lamp to avoid the death of the King Liuha Jie Gannon, the general constitution of the thick island of who Honche cannon spot to know the spirit of the egg closed children release milk giant private silver Ychintan fatigue mold Dulle Isolated bending performance strokes Shaoxing hu call Pain Peak 0 Chai Spring Noon Jump Habitat Shangding Qin slightly chasing beam depletion alkali post digging blade drama pile-up Chest Heng Qin film article in the case of seedling slow convex service shears Sichuan snow chain fishing face home of the Yang Zongjio to buy the flag filter silicon carbon stocks sit steam trap gun save take dark hole crime tube You song arc explosion fallacy Tu Jin arm barrier brown land Ah Jian Zun Bean pull mo thumper around seam police pick dirty ice Cambodian mouth what rice plastic send Zhao shout mat dan Watanabe planing Tiger pen dilute kun lang tea drip shallow hug mouth cover lun Niang ton dip sleeve Beads The female mother purple play Tower hammer quake old appearance clean the front of the fire, the fire of the Flash PO fierce and sudden disaster, Joe Tang leak smell shen melt chlorine waste stem man where rob like Pulp beside the glass also loyal sing to catch the lock, especially by Uzhi light allowable rebel livestock prisoner to touch rust sweep Bilibao core ye jian qi jiang calcium shoulder teng withered throw rail Hall mix dad lure 祝励 Ken wine rope Poor pond dry bubble bag long feeding aluminum soft channel of habitual trade manure wall trend of the anti-dumping air clothing Sun Ling Ridge cheat Hugh Borrow ". $addChars;
Break
Default:
The default is to remove the easily confusing characters Ooll and number 01, to add please use the Addchars parameter
$chars = ' ABCDEFGHIJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789 '. $addChars;
Break
}
if ($len >10) {//bit too long repeating string a certain number of times
$chars = $type ==1? Str_repeat ($chars, $len): Str_repeat ($chars, 5);
}
if ($type!=4) {
$chars = Str_shuffle ($chars);
$str = substr ($chars, 0, $len);
}else{
Chinese random word
for ($i =0; $i < $len; $i + +) {
$str. = Self::msubstr ($chars, Floor (Mt_rand (0,mb_strlen ($chars, ' Utf-8 ')-1)), 1, ' Utf-8 ', false);
}
}
return $str;
}
Randstring-----------thinkphp