-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
  • 4,084
  • 4
  • 29
  • 40

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
  • 26,538
  • 10
  • 45
  • 61
1

Use this

echo "<input type='text' value='" . $value . "' name='" . $input_id . "'/>";
I'm Geeker
  • 4,601
  • 5
  • 22
  • 41