Kenny Kiriga Kenny Kiriga - 1 year ago 91
HTML Question

Echoing variable in php

Essentially I am trying to have a heading using what is below. Not sure what is going on but nothing happens. Even when I do something as simple as echo "hello" there instead of the 2 variables.

<h1><?echo "$info[0] ($info[1])";?></h1>

Answer Source

You can use <?= ?> shorthand for echoing variables and the code should look like,

<h1><?= "$info[0] ($info[1])"; ?></h1>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download