承接 thearkaid/simple-name-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thearkaid/simple-name-generator

Composer 安装命令:

composer require thearkaid/simple-name-generator

包简介

Generate a random name that truely random

README 文档

README

Introduction

Welcome to the Simple Name Generator! This PHP class generates truely random given names, surnames, and full names based on specified lengths. The names are constructed using a pattern of consonants and vowels to ensure they resemble real names.

*Well it's not even a name, just a random word generator based on vowels and consonants :p.

The Logic

The SimpleNameGenerator class uses a simple yet effective logic to generate names:

  1. Vowels and Consonants: The generator has predefined sets of vowels (a, e, i, o, u) and consonants (b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z).

  2. Pattern Generation: Based on the specified length, the class creates a pattern of consonants and vowels:

    • Minimum length is 3. If a length less than 3 is specified, it defaults to 3.
    • If the length is exactly 3, the pattern is CVC.
    • For lengths greater than 3, the pattern is extended by repeating VC:
      • If the length is even, the pattern continues as CVCV....
      • If the length is odd, the pattern continues as CVC...V.
  3. Random String Generation: The class uses the generated pattern to construct a name by randomly selecting vowels and consonants from their respective sets.

How to Use

Installation

  1. composer thearkaid/simple-name-generator
  2. require_once 'vendor/autoload.php';

Example Usage

Check the example.php file for a quick example on how to use the SimpleNameGenerator;

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固