0

I'm trying to echo some variables in this format: <var1> <var2> <var3> <var4>.

I tried:

echo "<$r[0]> <$r[1]> <$r[2]> <$r[3]>";

But it doesn't show any output. How can I make it work?

Julia
  • 1,950
  • 1
  • 9
  • 22
  • 2
    It's probably printing fine, but `<>` are used for HTML, so the browser is probably not interpreting them. If you look at the source, you'll see the string printed out as you defined it. – aynber May 19 '22 at 18:10
  • 1
    In addition to what aynber said, if you need `<` and `>` to actually be displayed, replace them with `<` and `>` – j08691 May 19 '22 at 18:11
  • Use `htmlspecialchars()` to encode the characters so that the browser doesn't treat them like HTML tags. – ADyson May 20 '22 at 15:48

0 Answers0