test
=============================
login.php
class User {
public $username;
public $password;
};
class Result {
public $totalProperty;
public $rows;
};
function user_create($username, $password)
{
$user = new User();
$user->username = $username;
$user->password = $password;
return $user;
}
$result = new Result();
$result->rows = array();
$result->rows[] = user_create('aaaaaaa', 'pppppppp');
$result->rows[] = user_create('bbbbbbb', 'dddddddd');
$result->rows[] = user_create('ccccccc', 'zzzzzzzz');
$result->rows[] = user_create('ddddddd', 'kkkkkkkk');
$result->rows[] = user_create('eeeeeee', 'aaaaaaaa');
$result->rows[] = user_create('fffffff', 'cccccccc');
$result->rows[] = user_create('ggggggg', 'pppppppp');
$result->totalProperty = count($result->rows);
echo json_encode($result);
?>
阅读(914) | 评论(0) | 转发(0) |