Skip to main content
codeigniter4

C_4 tutorial

Luckmoshy
By Luckmoshy · Published:
Last updated: · No comments

 

How to Generate Random Name of Person in PHP


While working in any application, sometimes we need lots of dummy data to test the workflow of entire application. Inside this article we will see how to generate random name of person in PHP with or without using faker library.

Faker library needs to be install by using composer. Once install, there are several properties, methods available to generate various type of fake data like Name, Email, Phone number etc.

This article is super easy to understand and implement in php programming. To use Faker library, your system must have composer installed. If don’t, please follow this article to install in Linux Operating System. How To Install Composer in Ubuntu 18.04 ?

Learn More –

To do for this article –

  • Generate Fake data for Name without using any library
  • Generate Names using Faker Library

Let’s get started.


Random Names without Using Any Library

Let’s create an application in PHP.

Create a folder with name php-random. Inside this folder create a file like index.php.

Open index.php and write this complete code into it.

index.php

To use function, simply call it by it’s name as –

Comments 0

Post a Comment

Cancel