【文件属性】:
文件名称:生成假数据的PHP库Faker.zip
文件大小:3.27MB
文件格式:ZIP
更新时间:2022-08-05 23:29:29
开源项目
Faker 是一个为你生成假数据的PHP库。当你需要填充一个测试数据库,或为你的web应用生成测试数据时,它能派上用场。
示例代码:
<?php
// require the Faker autoloader
require_once '/path/to/Faker/src/autoload.php';
// alternatively, use another PSR-0 compliant autoloader (like the Symfony2 ClassLoader for instance)
// use the factory to create a Faker\Generator instance
$faker = Faker\Factory::create();
// generate data by accessing properties
echo $faker->name;
// 'Lucy Cechtelar';
echo $faker->address;
// "426 Jordy Lodge
// Cartwrightshire, SC 88120-6700"
echo $faker->text;
标签:Faker