in reply to Array problems.

You wrote $chemical = $periodicTable[$i][1] instead $chemical == $periodicTable[$i][1] (so you are first changing the value of $chemical, and then checking that it is not null)

Edit: it looks like I'm a bit slow :)