Answer the question
In order to leave comments, you need to log in
Outputting an array element with a condition on another array element?
There is this array $services
:
Array
(
[0] => Array
(
[id_room] => 1
[id_service] => 1
[service_name] => Обслуживание
)
[1] => Array
(
[id_room] => 2
[id_service] => 1
[service_name] => Обслуживание
)
[2] => Array
(
[id_room] => 1
[id_service] => 2
[service_name] => Развлечения
)
)
service_name
if id_room
, for example, is equal to 1
. for ($i = 0; $i < 3; $i++){
if($services[$i]['id_room'] = 1){
echo $services[$i]['service_name'];
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question