Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code for creating random Safaricom Kenya Phone numbers (accompanying blog post: https://blog.muya.co.ke/random-safaricom-kenya-phone-numbers/)
<?php
// include Faker in your project (https://github.com/fzaninotto/Faker#installation)
use Faker\Factory as Faker;
$faker = Faker::create();
$regex = "/(\+?254|0){1}[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}/";
$samplePhoneNumber = $faker->regexify($regex);
echo $samplePhoneNumber . "\n";
@peter010

This comment has been minimized.

Copy link

peter010 commented Apr 6, 2017

How do I create a phone number am confused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.