Answer the question
In order to leave comments, you need to log in
How to collect values in one line and output?
Ku! Please help, how to collect the value in one line and display it?
$arr = array("gd" => 3, "hedh" => 0);
arsort($arr);
$plat = 1;
foreach ($arr as $key => $val ) {
$text = "{$place} - {$key}: {$val}";
//$text - это не правильно
$plat++;
}
Answer the question
In order to leave comments, you need to log in
$arr = array("gd" => 3, "hedh" => 0);
arsort($arr);
$plat = 1;
$text = '';
foreach ($arr as $key => $val ) {
$text = $text." ".$place." - ".$key.": ".$val;
//$text - это не правильно
$plat++;
}
echo $text;
Read about the concatenation operator, if I understood you correctly.
$text = $place . ' - ' . $key . ': ' . $val;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question