How can PHP be used to dynamically highlight and display information for different rooms in a building floor plan?
To dynamically highlight and display information for different rooms in a building floor plan using PHP, you can create an array of room information with keys corresponding to room numbers or IDs. Then, based on user input or selection, you can use PHP to retrieve and display the information for the selected room.
<?php
// Array of room information
$rooms = array(
'101' => 'Room 101: Conference Room',
'102' => 'Room 102: Office',
'103' => 'Room 103: Break Room',
// Add more room information as needed
);
// Get user-selected room number
$selected_room = $_GET['room'];
// Display information for the selected room
if (array_key_exists($selected_room, $rooms)) {
echo $rooms[$selected_room];
} else {
echo 'Room not found';
}
?>