ᅠᅠ
$data
это кол-во пользователейSize: a a a
ᅠᅠ
$data
это кол-во пользователейMB
login
и password
? Ты можешь тупо по порядку ебашить логин и парольMB
array_push($data, array('Login goes here', 'Password goes here', 'User goes here'));
array_push($data, array('Login goes here', 'Password goes here', 'User goes here'));
array_push($data, array('Login goes here', 'Password goes here', 'User goes here'));
echo $data[0][0];
ᅠᅠ
$data = array();
array_push($data, array('login' => 'Login goes here', 'password' => 'Password goes here', 'user' => 'User goes here'));
array_push($data, array('login' => 'Login goes here', 'password' => 'Password goes here', 'user' => 'User goes here'));
array_push($data, array('login' => 'Login goes here', 'password' => 'Password goes here', 'user' => 'User goes here'));
$json = json_encode($data);
echo $json;
MB
array_push
столько и паролей будет. Столько и пользователейMB
array_push($data, array('Login goes here', 'Password goes here', 'User goes here'));
array_push($data, array('Login goes here', 'Password goes here', 'User goes here'));
array_push($data, array('Login goes here', 'Password goes here', 'User goes here'));
echo $data[0][0];
$data[0][0];
- логин первого пользователяMB
$data[0][1];
- пароль первого пользователяᅠᅠ
$data[0][0];
- логин первого пользователяᅠᅠ
ᅠᅠ
MB
MB
MB
foreach($json as $user) {
echo $user->login.', '.$user->password.'<br>';
}
MB
MB
foreach($json as $id => $user) {
echo $user->login.', '.$user->password.'<br>';
}
MB
$id
порядковый номер массива и будет являться ID пользователяMB
$user
уже все данные остальныеᅠᅠ
MB
$_CONFiG['users'] = $data
весь массив, прочитанный из файла. Но там будет уже не строка, а массивMB