Hi, can someone help me with replacing the indices in the indexed array with the keys from the associate array while the final array will still be stored back to the indexed array?
<?php
$Refractive_Index = [
"Water" => 1.333,
"Ethanol" => 1.36,
"Olive oil" => 1.47,
"Ice" => 1.31,
"Fused silica" => 1.46,
"PMMA" => 1.49,
"Window glass" => 1.52,
"Polycarbonate" => 1.58,
"Sapphire" => 1.77,
"Diamond" => 2.42
];
$Critical_Angle = [48.6, 47.3, 42.9, 49.8, 43.2, 42.2, 41.1, 39.3, 34.4, 24.4];
?>
<html>
<table>
<?php
foreach ($Refractive_Index as $key =>$value)
{
?><tr>
<td style='border: 1px solid #000;'><?php echo $key; ?></td>
<td style='border: 1px solid #000;'><?php echo $value; ?></td>
</tr>
<?php
}
?>
</table>
</html>
Iβd like the output to be something similar to this:
Water ββββ ββββ ββββ ββββ ββββ ββββ - 48.6
Ethanol ββββ ββββββ ββββ ββββ - 47.3
Olive Oil βββββ β ββββ - 48.6
Ice ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ - 49.8
βββββββββββββββββββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ β¦βand so on
Thank you so much!