-1

Googled but couldn't find an answer.

I have

echo "<input type = 'text' value = ".$value." name = ".$input_id."/>";

$value or $input_id contains a dot which is conflicting with the dot used for concatenation. How do I escape it?

Thanks!

aandis
  • 3,634
  • 4
  • 26
  • 38

2 Answers2

1

If the variables contains eg. space, they has to be in quotes. Concat operators cause no problem.

echo "<input type='text' value='" . $value . "' name='" . $input_id . "'/>";
pavel
  • 25,361
  • 10
  • 41
  • 58
1

Use this

echo "<input type='text' value='" . $value . "' name='" . $input_id . "'/>";
I'm Geeker
  • 4,646
  • 5
  • 20
  • 40