Skip to content

Instantly share code, notes, and snippets.

@joshhartman
Last active August 15, 2023 13:29
Show Gist options
  • Save joshhartman/e1e65674986fb6b3e61026738872089f to your computer and use it in GitHub Desktop.
Save joshhartman/e1e65674986fb6b3e61026738872089f to your computer and use it in GitHub Desktop.
Memorable Passphrase Generator (Requires PHP 7.1+)
<?php
function randomPassphrase( $numwords = 3, $minlength = 16, $ucfirst = true, $spchar = true )
{
if ( $numwords < 3 ) {
$numwords = 3;
} elseif ( $numwords > 6 ) {
$numwords = 6;
}
if ( $minlength < $numwords * 4.5 ) {
$minlength = $numwords * 5;
} elseif ( $minlength > $numwords * 8.5 ) {
$minlength = $numwords * 8;
}
$words = [ 'abandon', 'ability', 'able', 'about', 'above', 'abroad', 'absence', 'absolute', 'absorb', 'abuse', 'academic', 'accept', 'acceptable', 'access', 'according', 'account', 'accountant', 'accurate', 'across', 'act', 'action', 'active', 'activity', 'actor', 'actress', 'actual', 'actually', 'adapt', 'add', 'additional', 'address', 'adjust', 'admit', 'adorable', 'adult', 'advance', 'advanced', 'adventurous', 'advice', 'affect', 'afford', 'afraid', 'after', 'afternoon', 'again', 'against', 'age', 'agency', 'agenda', 'agent', 'ago', 'agree', 'agreeable', 'agreement', 'ahead', 'aid', 'air', 'airline', 'airport', 'album', 'alive', 'all', 'allow', 'almost', 'alone', 'along', 'already', 'also', 'although', 'always', 'amazing', 'among', 'amount', 'amused', 'analysis', 'ancient', 'angry', 'animal', 'annual', 'another', 'answer', 'anxious', 'anyone', 'anything', 'apart', 'apartment', 'apparent', 'appeal', 'appear', 'apple', 'apply', 'approach', 'approval', 'approve', 'architect', 'area', 'arm', 'around', 'arrive', 'art', 'article', 'artist', 'ash', 'ask', 'asleep', 'aspen', 'assert', 'asset', 'assist', 'assistant', 'assume', 'astronaut', 'athletic', 'attack', 'attention', 'attractive', 'audience', 'author', 'authority', 'auto', 'automatic', 'available', 'average', 'avoid', 'award', 'aware', 'away', 'awful', 'baby', 'back', 'background', 'bad', 'bag', 'baker', 'balance', 'ball', 'band', 'bank', 'bar', 'barrel', 'base', 'basic', 'basis', 'basket', 'battery', 'beach', 'bean', 'bear', 'beat', 'beautiful', 'because', 'become', 'bed', 'bee', 'before', 'begin', 'beginning', 'behavior', 'behind', 'believe', 'bell', 'below', 'belt', 'bench', 'bend', 'benefit', 'best', 'better', 'between', 'beyond', 'big', 'bike', 'bill', 'billion', 'biologist', 'birch', 'bird', 'bit', 'bitter', 'black', 'blanket', 'blind', 'block', 'blue', 'board', 'boat', 'body', 'bond', 'book', 'boot', 'border', 'bored', 'born', 'both', 'bottle', 'bowl', 'box', 'boy', 'brain', 'brainy', 'branch', 'brave', 'break', 'breakable', 'brick', 'bridge', 'brief', 'bright', 'brilliant', 'bring', 'broad', 'broken', 'brown', 'brush', 'budget', 'build', 'building', 'business', 'busy', 'but', 'butcher', 'buy', 'cabin', 'cable', 'cake', 'call', 'calm', 'camera', 'camp', 'campaign', 'campus', 'can', 'candidate', 'cap', 'capable', 'capital', 'captain', 'car', 'carbon', 'card', 'care', 'career', 'careful', 'carpenter', 'carry', 'case', 'cash', 'cashier', 'cat', 'catch', 'cause', 'cautious', 'cedar', 'cell', 'center', 'central', 'century', 'certain', 'certainly', 'chain', 'chair', 'challenge', 'champion', 'chance', 'change', 'channel', 'chapter', 'character', 'charge', 'charming', 'chart', 'cheap', 'check', 'cheerful', 'chef', 'chemical', 'chicken', 'chief', 'child', 'chip', 'choice', 'choose', 'circle', 'citizen', 'city', 'civil', 'claim', 'class', 'classic', 'clean', 'cleaner', 'clear', 'clearly', 'clever', 'climate', 'clinic', 'clock', 'close', 'cloth', 'cloud', 'cloudy', 'clumsy', 'coach', 'coal', 'coast', 'coat', 'coffee', 'cold', 'collection', 'college', 'color', 'colorful', 'combative', 'come', 'comfortable', 'command', 'common', 'community', 'company', 'compare', 'complete', 'complex', 'computer', 'concern', 'concerned', 'concert', 'concrete', 'condemned', 'condition', 'conference', 'confident', 'confuse', 'connect', 'conscious', 'consider', 'consistent', 'constant', 'consultant', 'consumer', 'contact', 'contain', 'container', 'content', 'contest', 'continue', 'contract', 'contrast', 'control', 'cook', 'cookie', 'cool', 'copy', 'coral', 'core', 'corn', 'corner', 'correct', 'cost', 'cotton', 'couch', 'could', 'count', 'counter', 'country', 'county', 'couple', 'courageous', 'course', 'court', 'cover', 'cow', 'coyote', 'crab', 'craft', 'crazy', 'create', 'creative', 'credit', 'crew', 'critical', 'crow', 'crowd', 'crowded', 'cup', 'curious', 'current', 'custom', 'customer', 'cut', 'cute', 'cycle', 'daily', 'dancer', 'dangerous', 'dark', 'data', 'day', 'deal', 'dear', 'death', 'debate', 'decade', 'decent', 'decide', 'decision', 'deck', 'deep', 'deer', 'defeated', 'defend', 'defendant', 'defense', 'defensive', 'defiant', 'deficit', 'define', 'degree', 'delay', 'delightful', 'deliver', 'delivery', 'demand', 'dentist', 'dependent', 'depict', 'depressed', 'deputy', 'describe', 'design', 'designer', 'desk', 'desperate', 'despite', 'detail', 'detailed', 'detective', 'determined', 'develop', 'device', 'devote', 'difficult', 'digital', 'dinner', 'direct', 'direction', 'director', 'dirt', 'discover', 'discuss', 'discussion', 'dish', 'display', 'distant', 'distinct', 'district', 'divide', 'dizzy', 'doctor', 'document', 'dog', 'dolphin', 'door', 'double', 'doubtful', 'dove', 'down', 'downtown', 'dozen', 'drab', 'draft', 'dramatic', 'draw', 'drawing', 'dream', 'dress', 'drive', 'driver', 'drop', 'drug', 'drunk', 'dry', 'ducks', 'due', 'dull', 'during', 'dust', 'eager', 'eagle', 'early', 'earn', 'earth', 'east', 'eastern', 'easy', 'eat', 'economic', 'economy', 'edge', 'edition', 'editor', 'education', 'effect', 'effective', 'efficient', 'effort', 'eight', 'either', 'elated', 'election', 'electric', 'electrician', 'elegant', 'element', 'elephant', 'elite', 'elm', 'emergency', 'emotional', 'employee', 'empty', 'enable', 'end', 'energetic', 'energy', 'engine', 'engineer', 'enjoy', 'enough', 'enter', 'entire', 'envious', 'episode', 'equal', 'equipment', 'error', 'escape', 'essential', 'establish', 'estimate', 'even', 'evening', 'event', 'ever', 'every', 'evidence', 'exact', 'exactly', 'examine', 'example', 'exceed', 'excellent', 'exchange', 'excited', 'exciting', 'executive', 'exercise', 'exhibit', 'exist', 'existing', 'expand', 'expect', 'expense', 'expensive', 'experience', 'expert', 'explain', 'explore', 'express', 'extend', 'extension', 'external', 'extra', 'extreme', 'eye', 'fabric', 'face', 'facility', 'fact', 'factor', 'factory', 'fade', 'fail', 'fair', 'faithful', 'fall', 'false', 'familiar', 'family', 'famous', 'fancy', 'fantastic', 'far', 'farm', 'farmer', 'fast', 'fat', 'father', 'favor', 'fear', 'feature', 'federal', 'feel', 'feeling', 'fence', 'fiber', 'fiction', 'field', 'fierce', 'fifth', 'fifty', 'fight', 'figure', 'file', 'fill', 'film', 'filthy', 'final', 'finally', 'financial', 'find', 'fine', 'finger', 'finish', 'fire', 'firm', 'first', 'fish', 'fit', 'fitness', 'five', 'fix', 'flag', 'flame', 'flamingo', 'flat', 'flight', 'float', 'floor', 'florist', 'flower', 'fly', 'focus', 'follow', 'food', 'foolish', 'foot', 'for', 'force', 'foreign', 'forest', 'forget', 'form', 'formal', 'former', 'formula', 'forward', 'found', 'four', 'fourth', 'fox', 'fragile', 'frame', 'free', 'freedom', 'freeze', 'frequency', 'frequent', 'fresh', 'friend', 'friendly', 'from', 'front', 'fruit', 'fuel', 'full', 'fun', 'fund', 'funny', 'future', 'galaxy', 'gallery', 'game', 'garage', 'garden', 'gardener', 'gas', 'general', 'generation', 'gentle', 'get', 'giant', 'gift', 'gifted', 'give', 'glad', 'glamorous', 'glass', 'gleaming', 'global', 'glorious', 'glove', 'goal', 'goat', 'gold', 'golden', 'good', 'goose', 'gorgeous', 'graceful', 'grade', 'grand', 'grant', 'grass', 'gray', 'great', 'green', 'grieving', 'gross', 'grotesque', 'ground', 'group', 'grow', 'growth', 'grumpy', 'guard', 'guess', 'guide', 'gun', 'guy', 'habitat', 'hair', 'half', 'hall', 'hamster', 'handle', 'handsome', 'hang', 'happen', 'happy', 'hard', 'hat', 'have', 'hawk', 'head', 'health', 'healthy', 'hear', 'heart', 'heat', 'heavy', 'hello', 'help', 'helpful', 'helpless', 'here', 'hero', 'hickory', 'hide', 'high', 'highway', 'hill', 'hippo', 'hire', 'historical', 'history', 'hit', 'hold', 'holiday', 'home', 'honest', 'honey', 'honor', 'hope', 'horizon', 'horse', 'hospital', 'host', 'hot', 'hotel', 'hour', 'house', 'how', 'however', 'huge', 'human', 'humor', 'hundred', 'hungry', 'hunter', 'hurt', 'ice', 'idea', 'ideal', 'identify', 'ill', 'illegal', 'image', 'imagine', 'immediate', 'impact', 'important', 'impossible', 'impressive', 'improve', 'incident', 'include', 'including', 'increase', 'indeed', 'indicate', 'industry', 'inform', 'initial', 'inner', 'innocent', 'inside', 'insight', 'install', 'instead', 'intense', 'interest', 'internal', 'interview', 'into', 'introduce', 'invite', 'involve', 'iron', 'island', 'issue', 'itchy', 'item', 'jacket', 'jealous', 'jet', 'jittery', 'job', 'join', 'joint', 'joke', 'jolly', 'journal', 'journalist', 'journey', 'joyous', 'juice', 'jump', 'junior', 'just', 'justice', 'kangaroo', 'keep', 'key', 'kind', 'kitchen', 'kitten', 'know', 'knowledge', 'known', 'lab', 'label', 'lake', 'land', 'landscape', 'language', 'large', 'last', 'late', 'later', 'latter', 'laugh', 'launch', 'law', 'lawn', 'lawyer', 'lay', 'layer', 'lazy', 'lead', 'leader', 'leading', 'leaf', 'lean', 'learn', 'least', 'leather', 'leave', 'left', 'leg', 'legacy', 'legal', 'legend', 'lemon', 'leopard', 'less', 'lesson', 'let', 'letter', 'level', 'library', 'license', 'life', 'lifeguard', 'light', 'like', 'likely', 'limit', 'limited', 'line', 'link', 'lion', 'list', 'listen', 'little', 'live', 'lively', 'living', 'load', 'loan', 'lobster', 'local', 'locate', 'location', 'lock', 'logical', 'lonely', 'long', 'look', 'loose', 'lose', 'loss', 'lost', 'lot', 'loud', 'love', 'lovely', 'low', 'lower', 'lucky', 'machine', 'mad', 'magazine', 'mail', 'main', 'maintain', 'major', 'majority', 'make', 'mall', 'manage', 'manager', 'manner', 'many', 'map', 'maple', 'margin', 'mark', 'market', 'mask', 'mass', 'massive', 'master', 'match', 'material', 'math', 'matter', 'maximum', 'may', 'maybe', 'mayor', 'measure', 'mechanic', 'media', 'medical', 'medicine', 'medium', 'meet', 'meeting', 'member', 'memory', 'mental', 'mention', 'message', 'meter', 'method', 'middle', 'might', 'military', 'million', 'mind', 'minimum', 'minor', 'minute', 'miracle', 'mirror', 'miss', 'mission', 'misty', 'mix', 'mobile', 'mode', 'model', 'modern', 'modest', 'moment', 'money', 'monitor', 'monkey', 'month', 'mood', 'more', 'morning', 'most', 'motion', 'motor', 'mountain', 'mouse', 'mouth', 'move', 'movement', 'movie', 'much', 'muddy', 'mushy', 'music', 'musician', 'must', 'myself', 'mysterious', 'myth', 'name', 'narrow', 'nation', 'national', 'native', 'natural', 'nature', 'near', 'nearby', 'nearly', 'neat', 'necessary', 'need', 'negative', 'neither', 'nerve', 'nervous', 'net', 'network', 'never', 'new', 'news', 'newspaper', 'next', 'nice', 'night', 'nine', 'noise', 'normal', 'north', 'note', 'nothing', 'notice', 'notion', 'novel', 'now', 'number', 'numerous', 'nurse', 'nutty', 'oak', 'obedient', 'objective', 'obnoxious', 'observe', 'observer', 'obvious', 'occasion', 'occur', 'ocean', 'octopus', 'odd', 'offer', 'office', 'officer', 'official', 'often', 'oil', 'okay', 'old', 'once', 'one', 'onion', 'online', 'only', 'onto', 'open', 'opening', 'operate', 'operation', 'opposite', 'option', 'orange', 'order', 'ordinary', 'organic', 'organize', 'origin', 'original', 'ostrich', 'other', 'others', 'otherwise', 'otter', 'out', 'outside', 'oven', 'over', 'overall', 'overlook', 'owl', 'own', 'owner', 'pace', 'pack', 'package', 'page', 'pain', 'paint', 'painter', 'painting', 'pair', 'pale', 'palm', 'pan', 'panda', 'panel', 'paper', 'parent', 'park', 'parking', 'parrot', 'part', 'partner', 'party', 'pass', 'passage', 'past', 'patch', 'path', 'patient', 'pattern', 'pay', 'peace', 'peacock', 'peak', 'pelican', 'penguin', 'people', 'pepper', 'per', 'perfect', 'perform', 'perhaps', 'period', 'permit', 'person', 'personal', 'pharmacist', 'phase', 'phone', 'photographer', 'phrase', 'physical', 'piano', 'pick', 'picture', 'pie', 'piece', 'pig', 'pigeon', 'pile', 'pilot', 'pine', 'pink', 'pipe', 'pitch', 'place', 'plain', 'plan', 'plane', 'planet', 'plant', 'plastic', 'plate', 'platform', 'play', 'player', 'pleasant', 'plenty', 'plot', 'plumber', 'plus', 'pocket', 'poem', 'poet', 'poetry', 'point', 'poised', 'police', 'policy', 'political', 'politician', 'politics', 'pool', 'poor', 'pop', 'popular', 'porch', 'port', 'portion', 'portrait', 'position', 'positive', 'possible', 'postman', 'pot', 'potential', 'pound', 'powder', 'power', 'powerful', 'practical', 'practice', 'precious', 'prefer', 'pregnant', 'prepare', 'present', 'president', 'press', 'pressure', 'pretend', 'pretty', 'prevent', 'previous', 'price', 'prickly', 'primary', 'prime', 'prior', 'private', 'prize', 'probably', 'problem', 'procedure', 'proceed', 'process', 'produce', 'product', 'production', 'professional', 'professor', 'profile', 'profit', 'program', 'progress', 'project', 'promise', 'promote', 'prompt', 'proof', 'proper', 'property', 'proposal', 'protect', 'proud', 'prove', 'provide', 'public', 'puppy', 'purchase', 'pure', 'purple', 'purpose', 'push', 'putrid', 'puzzled', 'quaint', 'quality', 'quarter', 'question', 'quick', 'quickly', 'quiet', 'quietly', 'quite', 'quote', 'rabbit', 'race', 'radio', 'rail', 'rain', 'raise', 'range', 'rank', 'rapid', 'rare', 'rate', 'rather', 'ratio', 'raven', 'reach', 'react', 'read', 'ready', 'real', 'realistic', 'reality', 'realize', 'really', 'reason', 'reasonable', 'receive', 'recent', 'recently', 'recipe', 'recognize', 'record', 'red', 'reduce', 'reflect', 'region', 'regional', 'register', 'regular', 'relate', 'relative', 'relevant', 'relieved', 'religious', 'remain', 'remember', 'remote', 'remove', 'report', 'represent', 'request', 'require', 'research', 'researcher', 'resident', 'resolve', 'resource', 'respond', 'response', 'responsible', 'rest', 'restore', 'result', 'retain', 'retire', 'return', 'reveal', 'review', 'rich', 'ride', 'right', 'ring', 'rise', 'risk', 'river', 'road', 'robin', 'rock', 'role', 'room', 'root', 'rope', 'rose', 'rough', 'round', 'routine', 'royal', 'rule', 'run', 'rural', 'sad', 'safe', 'safety', 'sale', 'sales', 'salt', 'same', 'sample', 'sand', 'save', 'savings', 'say', 'scale', 'scared', 'scary', 'scene', 'schedule', 'scheme', 'scholar', 'school', 'science', 'scientist', 'scope', 'score', 'screen', 'script', 'seal', 'search', 'season', 'seat', 'second', 'secret', 'section', 'sector', 'secure', 'security', 'seed', 'seek', 'seem', 'segment', 'select', 'selfish', 'sell', 'send', 'senior', 'sense', 'sensitive', 'separate', 'series', 'serious', 'serve', 'service', 'session', 'set', 'seven', 'several', 'severe', 'shade', 'shadow', 'shake', 'shape', 'share', 'shark', 'sharp', 'sheep', 'sheet', 'shelf', 'shell', 'shells', 'shelter', 'shift', 'shine', 'shiny', 'ship', 'shirt', 'shock', 'shoe', 'shoot', 'shop', 'shore', 'short', 'shot', 'should', 'shoulder', 'shout', 'show', 'shrimp', 'shy', 'sick', 'side', 'sign', 'signal', 'silence', 'silent', 'silly', 'silver', 'similar', 'simple', 'simply', 'since', 'sing', 'singer', 'single', 'sink', 'site', 'situation', 'six', 'size', 'ski', 'skill', 'skin', 'sky', 'sleepy', 'slice', 'slide', 'slight', 'slip', 'slow', 'small', 'smart', 'smile', 'smiling', 'smoggy', 'smoke', 'smooth', 'snap', 'snow', 'social', 'society', 'soft', 'soil', 'solar', 'soldier', 'solid', 'solution', 'solve', 'somehow', 'somewhat', 'song', 'soon', 'sore', 'sorry', 'sort', 'sound', 'soup', 'source', 'south', 'southern', 'space', 'spare', 'sparkling', 'sparrow', 'speak', 'speaker', 'special', 'specialist', 'specific', 'speech', 'speed', 'spend', 'spin', 'spiritual', 'splendid', 'split', 'sport', 'spot', 'spotless', 'spring', 'spruce', 'square', 'squid', 'stable', 'staff', 'stage', 'stair', 'stake', 'stand', 'standard', 'standing', 'star', 'starfish', 'start', 'state', 'statement', 'station', 'status', 'stay', 'steady', 'steel', 'step', 'stick', 'still', 'stir', 'stock', 'stone', 'stop', 'storage', 'store', 'stork', 'stormy', 'story', 'straight', 'strange', 'strategy', 'street', 'strength', 'strict', 'string', 'strong', 'structure', 'student', 'studio', 'study', 'stuff', 'stupid', 'style', 'subject', 'substantial', 'success', 'successful', 'such', 'sudden', 'suddenly', 'suffer', 'sufficient', 'sugar', 'suggest', 'suggestion', 'suitable', 'summer', 'summit', 'sun', 'super', 'supply', 'support', 'supporter', 'supreme', 'sure', 'surface', 'surprise', 'surround', 'survey', 'survive', 'suspect', 'suspicious', 'swan', 'sweep', 'sweet', 'swimming', 'switch', 'symbol', 'system', 'table', 'tactic', 'take', 'tale', 'talented', 'talk', 'tall', 'tame', 'tap', 'tape', 'target', 'task', 'taste', 'tasty', 'tax', 'teach', 'teacher', 'team', 'technical', 'technology', 'telephone', 'telescope', 'television', 'tell', 'temporary', 'ten', 'tend', 'tender', 'tense', 'tent', 'term', 'terms', 'terrible', 'test', 'text', 'thank', 'thankful', 'theater', 'theory', 'therapy', 'thick', 'thin', 'thing', 'think', 'third', 'thirty', 'thought', 'thoughtful', 'thousand', 'threat', 'three', 'through', 'throughout', 'throw', 'ticket', 'tie', 'tight', 'time', 'tiny', 'tip', 'tire', 'tired', 'title', 'today', 'together', 'tomato', 'tomorrow', 'tone', 'tonight', 'tool', 'top', 'topic', 'total', 'tough', 'tour', 'tourist', 'toward', 'tower', 'town', 'trace', 'track', 'trade', 'traditional', 'traffic', 'trail', 'train', 'training', 'transfer', 'transform', 'translate', 'translator', 'travel', 'treat', 'treatment', 'tree', 'trend', 'trial', 'trick', 'trip', 'trouble', 'troubled', 'truck', 'true', 'trust', 'truth', 'try', 'tulip', 'tunnel', 'turkey', 'turn', 'turtle', 'twelve', 'twenty', 'twice', 'twin', 'two', 'type', 'typical', 'ultimate', 'under', 'understand', 'uniform', 'union', 'unique', 'unit', 'united', 'universal', 'universe', 'unknown', 'unlikely', 'until', 'unusual', 'upon', 'upper', 'urban', 'used', 'useful', 'user', 'usual', 'usually', 'utility', 'vacation', 'valley', 'valuable', 'value', 'variable', 'variation', 'variety', 'various', 'vast', 'vegetable', 'vehicle', 'venture', 'version', 'very', 'vessel', 'veteran', 'victorious', 'victory', 'video', 'view', 'viewer', 'village', 'virtual', 'virtue', 'virus', 'visible', 'vision', 'visit', 'visitor', 'visual', 'vital', 'voice', 'volume', 'volunteer', 'vote', 'vulnerable', 'wage', 'wait', 'walk', 'wall', 'walnut', 'walrus', 'wander', 'wandering', 'want', 'war', 'warm', 'warn', 'warning', 'wash', 'waste', 'watch', 'water', 'wave', 'way', 'weak', 'wealth', 'weapon', 'wear', 'weary', 'week', 'weekend', 'weekly', 'weight', 'weird', 'welcome', 'well', 'west', 'western', 'wet', 'whale', 'what', 'whatever', 'wheel', 'when', 'where', 'whether', 'which', 'while', 'whisper', 'white', 'whole', 'wide', 'wild', 'will', 'willing', 'willow', 'win', 'wind', 'window', 'wine', 'wing', 'winner', 'winter', 'wire', 'wisdom', 'wise', 'wish', 'with', 'within', 'without', 'witness', 'witty', 'wonder', 'wonderful', 'wooden', 'word', 'work', 'worker', 'working', 'world', 'worth', 'would', 'wrap', 'write', 'writer', 'wrong', 'yard', 'year', 'yellow', 'yet', 'yield', 'young', 'zany', 'zealous', 'zone', 'zoom' ];
$words_count = count( $words );
$spchars = array( '!', '@', '#', '$', '%', '^', '&', '*', '-', '+', '?', '=', '~' );
$output = '';
do {
$passphrase_words = [];
for ( $x = 1; $x <= $numwords; $x ++ ) {
$new_word = $words[ random_int( 0, $words_count - 1 ) ];
while ( $x > 1 && in_array( $new_word, $passphrase_words, true ) == true ) {
$new_word = $words[ random_int( 0, $words_count - 1 ) ];
}
if ( $ucfirst ) {
$new_word = ucfirst( $new_word );
}
$passphrase_words[] = $new_word;
}
$passphrase_words = implode( $passphrase_words );
$passphrase_words_length = strlen( $passphrase_words );
} while ( $passphrase_words_length > $minlength || $passphrase_words_length < $minlength - 3 );
$output .= $passphrase_words;
$output .= random_int( 100, 999 );
if ( $spchar ) {
$output .= $spchars[ random_int( 0, 12 ) ];
}
return $output;
}
echo randomPassphrase();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment