# timetics/1.0.13/core/dummy-data/provider/internet.php

Timetics – Appointment Booking Calendar &amp; Scheduling, version 1.0.13. 75 lines.

- Page: https://pluginprobe.com/plugins/timetics/1.0.13/code/core/dummy-data/provider/internet.php
- Raw: https://pluginprobe.com/plugins/timetics/1.0.13/raw/core/dummy-data/provider/internet.php
- Modified: 2023-11-05T06:29:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/timetics/1.0.13/code/core/dummy-data/provider/internet.php#L10-L20`.

```php
<?php
/**
 * Internet Faker Class
 *
 * @package Timetics
 */
namespace Timetics\Core\DummyData\Provider;

/**
 * Internet Faker Class
 */
class Internet {
    /**
     * Store Internet Free Domain
     *
     * @var array
     */
    protected static $domains = ['gmail.com', 'yahoo.com', 'hotmail.com'];

    /**
     * Store random character
     *
     * @var string
     */
    protected static $str = 'abcdefghijklmnopqrstuvwxyz12345_-.';

    /**
     * Get username
     *
     * @return  string
     */
    public static function username() {
        $strLength = strlen( self::$str );

        // Generate a random start position within the valid range
        $start_pos = mt_rand( 0, max( 0, $strLength - 5 ) );

        // Extract the random substring using substr()
        $random_substring = substr( self::$str, $start_pos, 5 );

        return $random_substring . '_' . time();
    }

    /**
     * Get generated email
     *
     * @return  string
     */
    public static function email() {
        $email = self::username() . '@' . self::domain();

        return $email;
    }

    /**
     * Get generated password
     *
     * @return  string
     */
    public static function password() {
        $password = uniqid() . '_' . time();

        return $password;
    }

    /**
     * Get domain name
     *
     * @return  string
     */
    private static function domain() {
        return self::$domains[array_rand( self::$domains )];
    }
}

```
