print implode('<br />', array_slice($text[1], 1, 1)); // вообще ересь
наprint '<br />' . sprintf('%d%%', $text[1][1]);
CREATE TABLE `users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`amount` float DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
INSERT INTO `users` (`id`, `name`, `amount`)
VALUES
(1,'user1',11.589),
(2,'user2',478.541),
(3,'user3',0.258);
$db = new mysqli('localhost', 'root', '', 'mytests');
$db->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);
$query = 'SELECT * FROM users';
$result = $db->query($query);
while($row = $result->fetch_assoc()) {
var_dump($row);
};
array(3) {
'id' =>
int(1)
'name' =>
string(5) "user1"
'amount' =>
double(11.589)
}
array(3) {
'id' =>
int(2)
'name' =>
string(5) "user2"
'amount' =>
double(478.541)
}
array(3) {
'id' =>
int(3)
'name' =>
string(5) "user3"
'amount' =>
double(0.258)
}
[ 'Петров' => ['Семен', 'Васильевич'] ];
хотя в реале так не хранят.