<html>
 <head>
  <title>PHP-Test</title>
  
  <style type="text/css">
        #mjPSE_tbl {

        }
        #mjPSE_tbl td.mjPSE_element {
            border: #000000 1px solid;
            border-radius: 5px;
            padding: .5em;
            margin: .3em;
        }
        #mjPSE_tbl td.mjPSE_element_active {
            border: #003eff 1px solid;
            border-radius: 5px;
            padding: .5em;
            margin: .3em;
            background-color: #007fff;
        }
        #mjPSE_tbl td.mjPSE_element_active a {
            text-decoration: none;
            color: #ffffff;
        }
        #mjPSE_tbl td.mjPSE_element_active a:hover {
            font-weight: bold;
        }
    </style>
 </head>
 <body>
 <?php
function e($k) {
     //  Element => array( id, Title, Link )
    $elements = array(
        'H'=>array(),
        'He'=>array(),
        'Li'=>array( lithium, 'Lithium' ),
        'Be'=>array( beryllium, 'Beryllium' ),
        'B'=>array( boron, 'Boron' ),
        'C'=>array( carbon, 'Carbon' ),
        'N'=>array(),
        'O'=>array(),
        'F'=>array(),
        'Ne'=>array(),
        'Na'=>array( natrium, 'Natrium' ),
        'Mg'=>array( magnesium, 'Magnesium' ),
        'Al'=>array( aluminium, 'Aluminium' ),
        'Si'=>array( silicon, 'Silicon' ),
        'P'=>array( phosphorus, 'Phosphorus' ),
        'S'=>array( sulfur, 'Sulfur' ),
        'Cl'=>array(),
        'Ar'=>array(),
        'K'=>array( potassium, 'Potassium' ),
        'Ca'=>array( calcium, 'Calcium' ),
        'Sc'=>array( scandium, 'Scandium' ),
        'Ti'=>array( titanium, 'Titanium' ),
        'V'=>array( vanadium, 'Vanadium' ),
        'Cr'=>array( chromium, 'Chromium' ),
        'Mn'=>array( manganese, 'Manganese' ),
        'Fe'=>array( iron, 'Iron' ),
        'Co'=>array( cobalt, 'Cobalt' ),
        'Ni'=>array( nickel, 'Nickel' ),
        'Cu'=>array( copper, 'Copper' ),
        'Zn'=>array( zinc, 'Zinc' ),
        'Ga'=>array( gallium, 'Gallium' ),
        'Ge'=>array( germanium, 'Germanium' ),
        'As'=>array( arsenic, 'Arsenic' ),
        'Se'=>array( selenium, 'Selenium' ),
        'Br'=>array(),
        'Kr'=>array(),
        'Rb'=>array( rubidium, 'Rubidium' ),
        'Sr'=>array( strontium, 'Strontium' ),
        'Y'=>array( ytterbium, 'Ytterbium' ),
        'Zr'=>array( zirconium, 'Zirconium' ),
        'Nb'=>array( niobium, 'Niobium' ),
        'Mo'=>array( molybdenum, 'Molybdenum' ),
        'Tc'=>array(),
        'Ru'=>array( ruthenium, 'Ruthenium' ),
        'Rh'=>array( rhodium, 'Rhodium' ),
        'Pd'=>array( palladium, 'Palladium' ),
        'Ag'=>array( silver, 'Silver' ),
        'Cd'=>array( cadmium, 'Cadmium' ),
        'In'=>array( indium, 'Indium' ),
        'Sn'=>array( tin, 'Tin' ),
        'Sb'=>array( antimony, 'Antimony' ),
        'Te'=>array( tellurium, 'Tellurium' ),
        'I'=>array( iodine, 'Iodine'),
        'Xe'=>array(),
        'Cs'=>array( cesium, 'Cesium' ),
        'Ba'=>array( barium, 'Barium' ),
        'La'=>array( lanthanum, 'Lanthanum' ),
        'Hf'=>array( hafnium, 'Hafnium' ),
        'Ta'=>array( tantalum, 'Tantalum' ),
        'W'=>array( tungsten, 'Tungsten' ),
        'Re'=>array( rhenium, 'Rhenium' ),
        'Os'=>array( osmium, 'Osmium' ),
        'Ir'=>array( idirium, 'Iridium' ),
        'Pt'=>array( platinum, 'Platinum' ),
        'Au'=>array( gold, 'Gold' ),
        'Hg'=>array( mercury, 'Mercury' ),
        'Tl'=>array( thallium, 'Thallium' ),
        'Pb'=>array( lead, 'Lead' ),
        'Bi'=>array( bismuth, 'Bismuth' ),
        'Po'=>array(),
        'At'=>array(),
        'Ra'=>array(),
        'Fr'=>array(),
        'Ac'=>array(),
        'Ce'=>array( cerium, 'Cerium' ),
        'Pr'=>array( praseodymium, 'Praseodymium' ),
        'Nd'=>array( neodymium, 'Neodymium' ),
        'Pm'=>array(),
        'Sm'=>array( samarium, 'Samarium' ),
        'Eu'=>array( europium, 'Europium' ),
        'Gd'=>array( gadolinum, 'Gadolinum' ),
        'Tb'=>array( terbium, 'Terbium' ),
        'Dy'=>array( dysprosium, 'Dysprosium' ),
        'Ho'=>array( holmium, 'Holmium' ),
        'Er'=>array( erbium, 'Erbium'),
        'Tm'=>array( thulium, 'Thulium' ),
        'Yb'=>array(),
        'Lu'=>array( lutetium, 'Lutetium' )
    );

        if (empty($k)) return '';
        else {
            if (array_key_exists($k, $elements)) {
                if (!empty($elements[$k][0])) return '<td class="mjPSE_element_active"><a href="https://mateck.com/'.$elements[$k][0].'" title="'.$elements[$k][1].'">'.$k.'</a></td>';
                else return '<td class="mjPSE_element">'.$k.'</td>';
            }
        }
    }
?>
 
<table id="mjPSE_tbl">
    <tr> <!-- 1 -->
        <?=e('H');?>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <?=e('He');?>
    </tr>
    <tr> <!-- 2 -->
        <?=e('Li');?>
        <?=e('Be');?>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <?=e('B');?>
        <?=e('C');?>
        <?=e('N');?>
        <?=e('O');?>
        <?=e('F');?>
        <?=e('Ne');?>
    </tr>
    <tr> <!-- 3 -->
        <?=e('Na');?>
        <?=e('Mg');?>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <?=e('Al');?>
        <?=e('Si');?>
        <?=e('P');?>
        <?=e('S');?>
        <?=e('Cl');?>
        <?=e('Ar');?>
    </tr>
    <tr> <!-- 4 -->
        <?=e('K');?>
        <?=e('Ca');?>
        <?=e('Sc');?>
        <?=e('Ti');?>
        <?=e('V');?>
        <?=e('Cr');?>
        <?=e('Mn');?>
        <?=e('Fe');?>
        <?=e('Co');?>
        <?=e('Ni');?>
        <?=e('Cu');?>
        <?=e('Zn');?>
        <?=e('Ga');?>
        <?=e('Ge');?>
        <?=e('As');?>
        <?=e('Se');?>
        <?=e('Br');?>
        <?=e('Kr');?>
    </tr>
    <tr> <!-- 5 -->
        <?=e('Rb');?>
        <?=e('Sr');?>
        <?=e('Y');?>
        <?=e('Zr');?>
        <?=e('Nb');?>
        <?=e('Mo');?>
        <?=e('Tc');?>
        <?=e('Ru');?>
        <?=e('Rh');?>
        <?=e('Pd');?>
        <?=e('Ag');?>
        <?=e('Cd');?>
        <?=e('In');?>
        <?=e('Sn');?>
        <?=e('Sb');?>
        <?=e('Te');?>
        <?=e('I');?>
        <?=e('Xe');?>
    </tr>
    <tr> <!-- 6 -->
        <?=e('Cs');?>
        <?=e('Ba');?>
        <?=e('La');?>
        <?=e('Hf');?>
        <?=e('Ta');?>
        <?=e('W');?>
        <?=e('Re');?>
        <?=e('Os');?>
        <?=e('Ir');?>
        <?=e('Pt');?>
        <?=e('Au');?>
        <?=e('Hg');?>
        <?=e('Tl');?>
        <?=e('Pb');?>
        <?=e('Bi');?>
        <?=e('Po');?>
        <?=e('At');?>
        <?=e('Ra');?>
    </tr>
    <tr> <!-- 7 -->
        <?=e('Fr');?>
        <?=e('Ra');?>
        <?=e('Ac');?>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr> <!-- 8 -->
        <td></td>
        <td></td>
        <?=e('Ce');?>
        <?=e('Pr');?>
        <?=e('Nd');?>
        <?=e('Pm');?>
        <?=e('Sm');?>
        <?=e('Eu');?>
        <?=e('Gd');?>
        <?=e('Tb');?>
        <?=e('Dy');?>
        <?=e('Ho');?>
        <?=e('Er');?>
        <?=e('Tm');?>
        <?=e('Yb');?>
        <?=e('Lu');?>
        <td></td>
        <td></td>
    </tr>
</table>
 
 </body>
</html>