<?php
$value="Hello";
echo '
<table border="1">
<tr>
<td>Row $value, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
';
?> 
Why i am not getting the Hello instead of $value. How to make it possible.
<?php
$value="Hello";
echo '
<table border="1">
<tr>
<td>Row $value, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
';
?> 
Why i am not getting the Hello instead of $value. How to make it possible.
Basic PHP parsing rules: Strings enclosed with single quotes (') are NOT evaluated by the PHP parser and any variables within are ignored as literal text. Try
echo "
 ...
   $value
 ...
";
instead. Note the use of double-quotes (").
Additionally, please don't use multi-line echoes. They're ugly to maintain. If you have to do multiline output or assignment, consider using a HEREDOC instead.
HEREDOCs remove the need to quote quotes, so your echo becomes:
echo <<<EOL
<table border="1">
   ...
   $values
   ...
</table>
EOL;
    You need to encapsulate it in double quotes so that the processor will evaluate any variables inside.
echo "
<table border='1'>
<tr>
<td>Row $value, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
";
    You can use variables inside double quotes like that, but not single quotes. Do this instead:
echo '
<table border="1">
  <tr>
    <td>Row '.$value.', cell 1</td>
    <td>Row 1, cell 2</td>
  </tr>
</table>';
Or you can do this and escape the quotes in your string:
echo "
<table border=\"1\">
  <tr>
    <td>Row $value, cell 1</td>
    <td>Row 1, cell 2</td>
  </tr>
</table>";
However, I recommend doing it the first way because it's more efficient and cleaner code.
The use of a string over multiple lines has never been a good solution for me. I prefer heredoc:
$value="Hello";
echo <<<EOD
    <table border="1">
    <tr>
        <td>Row {$value}, cell 1</td>
        <td>Row 1, cell 2</td>
    </tr>
    </table>
EOD;
    Reason is that if you will use single quotes then parser will not look for variables in it. For that either you need to use double quotes or place variable outside single quotes.
<?php
$value="Hello";
echo '
<table border="1">
<tr>
<td>Row '. $value .', cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
';
?> 
OR
<?php
$value="Hello";
echo "
<table border='1'>
<tr>
<td>Row $value, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
</table>
";
?>